ReduxSimpleStarter icon indicating copy to clipboard operation
ReduxSimpleStarter copied to clipboard

Module build failed

Open varmab opened this issue 10 years ago • 5 comments

Do you know why it is failing to build on npm start?

ERROR in ./src/index.js Module build failed: SyntaxError: /Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/src/index.js: Unexpected token (12:2) 10 | 11 | ReactDOM.render(

12 | <Provider store={createStoreWithMiddleware(reducers)}> | ^ 13 | <App /> 14 | </Provider> 15 | , document.querySelector('.container')); at Parser.pp.raise (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:1413:13) at Parser.pp.unexpected (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:2895:8) at Parser.pp.parseExprAtom (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:746:12) at Parser.pp.parseExprSubscripts (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:501:19) at Parser.pp.parseMaybeUnary (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:481:19) at Parser.pp.parseExprOps (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:412:19) at Parser.pp.parseMaybeConditional (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:394:19) at Parser.pp.parseMaybeAssign (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:357:19) at Parser.pp.parseExprListItem (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:1224:16) at Parser.pp.parseCallExpressionArguments (/Users/varmabhupatiraju/Documents/Projects/mybusinessapp/ReactSimpleStarter/node_modules/babel-core/node_modules/babylon/index.js:577:20) @ multi main webpack: bundle is now VALID.

varmab avatar Jan 08 '16 19:01 varmab

came across same problem update your webpack.config.js module section with:

module: {
    loaders: [{
      exclude: /node_modules/,
      loader: 'babel',
      query: {
        presets: ['es2015', 'react']
      }
    }]
  },

ghost avatar Jan 27 '16 23:01 ghost

for me, i installed this https://babeljs.io/docs/plugins/preset-stage-0/ and then used "presets": ["es2015", "stage-0", "react"] for my presets

matthewchung74 avatar Mar 02 '16 22:03 matthewchung74

Go to your index.js file. If there's a semi-colon after a closing div, like this:

</div>;

delete the semi-colon!

I don't know if this was your issue but I had a similar problem... in Section 1, Lecture 14 minute 7:17 you can see the instructor has a semi-colon after the closing div on line 13. It was most likely a typo because he deletes it without saying anything at minute 7:28. At least for me, webpack was failing to compile because of the syntax error. Once I deleted the semi-colon, everything worked!

rachelruderman avatar May 16 '17 04:05 rachelruderman

./src/index.js Syntax error: F:/project/my-app/src/index.js: Unexpected token, expected , (13:1)

11 | <Hello />, 12 |

13 | document.getElementById('app')); | ^ 14 | //registerServiceWorker(); 15 |

How to solve this problem

udhayasuresh avatar Jun 05 '18 08:06 udhayasuresh

Failed to compile.

./src/app/recipe-list/recipe-list.component.ts Module build failed (from ./node_modules/@ngtools/webpack/src/index.js): Error: ENOENT: no such file or directory, open 'C:\Users\minoltan\Downloads\Video\angular tamil\projects\Recipe\src\app\recipe-list\recipe-list.component.ts'

how to solve this problem

minoltan avatar Oct 25 '18 03:10 minoltan