webpack-example icon indicating copy to clipboard operation
webpack-example copied to clipboard

.babelrc required

Open bohlander opened this issue 10 years ago • 4 comments

Hi Richard, wasn't sure the best way to reach you, but I was working through your tutorial https://underthehood.myob.com/changing-of-the-guard-in-web-technologies/ and kept getting a build error. I diffed my work vs. what you committed to this repo, and it looks like the .babelrc file is required. You can repro by deleting the .babelrc and trying to build. You might want to update the tutorial to mention it. Cheers, and thanks for the helpful tutorial

bohlander avatar Aug 21 '15 23:08 bohlander

Spot on. Several people mentioned it recently.The post forgot to talk about the .babelrc file. I am working on more advanced topics at the moment for forthcoming posts but I will take your advice and amend the original tutorial soon. Thanks.

richard-lopes avatar Aug 22 '15 04:08 richard-lopes

Keeping this open until tutorial is updated.

richard-lopes avatar Aug 22 '15 04:08 richard-lopes

Same here. Worked fine after adding the .babelrc file.

Thanks for this great tutorial by the way :)

konpa avatar Sep 16 '15 10:09 konpa

Encountered this same problem and was able to resolve using the above. For reference, the error I got was

ERROR in ./src/components/example.js
Module build failed: SyntaxError: /Users/aaron/projects/webpacktest/src/components/example.js: Unexpected token (6:0)
  4 | import DummyActions from 'actions/dummyActions';
  5 |
> 6 | @connectToStores
    | ^
  7 | class Example extends React.Component {

agrberg avatar Oct 29 '15 18:10 agrberg