Error while parsing JSON - unexpected 'r'


#1

I am just finishing off the steps to get a local app to run.

https://www.codecademy.com/articles/react-setup-v

It builds but it is throwing this error. Also my local page is built I guess but it is only showing the title for the page and it isn't displaying anything.

Uncaught Error: Module build failed: SyntaxError: C:\Users\Admin\Documents\Git\project\App.babelrc: Error while parsing JSON - Unexpected 'r'
at JSON5.parse.error (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:50:25)
at JSON5.parse.word (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:378:13)
at JSON5.parse.value (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:478:56)
at JSON5.parse.array (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:402:36)
at JSON5.parse.value (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:469:20)
at JSON5.parse.object (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:444:35)
at JSON5.parse.value (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:467:20)
at Object.parse (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\node_modules\json5\lib\json5.js:491:18)
at ConfigChainBuilder.addConfig (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\file\options\build-config-chain.js:154:65)
at ConfigChainBuilder.findConfigs (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\file\options\build-config-chain.js:100:16)
at buildConfigChain (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\file\options\build-config-chain.js:65:13)
at OptionManager.init (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\file\options\option-manager.js:324:58)
at File.initOptions (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\file\index.js:216:65)
at new File (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\file\index.js:137:24)
at Pipeline.transform (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (C:\Users\Admin\Documents\Git\project\App\node_modules\babel-loader\index.js:38:20)

Here is the code that I have in index.js and .babelrc:

var React = require('react');
var ReactDOM = require('react-dom');
var App = require('./components/App');

ReactDOM.render(
	<App />, 
	document.getElementById('app')
	);



----------


{presets: [react] }

EDIT: After just double checking my code I was missing '' in the code above. it should be {presets: ['react'] }


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.