Next.js: Module build failed: SyntaxError: Unexpected token (2:2)

Created on 24 Jan 2018  路  3Comments  路  Source: vercel/next.js

The boiler project in https://learnnextjs.com does not run due " Module build failed: SyntaxError: Unexpected token (2:2) " error pops up. I have found out it has something to do with my Babel settings but I have not found the exact solution yet.

Expected Behavior:

Hot reload should output a Hello World to the browser window

Current Behavior:

The browser outputs:

Module build failed: SyntaxError: Unexpected token (2:2)
image

Most helpful comment

Solved this by listing all files on my mac workstation Uses/Username -folder
$ ls -al
the result shows that I have a global .babelrc -file. Removed this file
$ rm ~/.babelrc
and Next works like a charm!

All 3 comments

same issue here

Solved this by listing all files on my mac workstation Uses/Username -folder
$ ls -al
the result shows that I have a global .babelrc -file. Removed this file
$ rm ~/.babelrc
and Next works like a charm!

Thanks alluster. I've been spenting hours to trying to resolve the same problem. Finally, my Next works like a charm too, using ur suggestion. Really appreciated.

I'm doing a Udemy course to develop a blockchain project. At the same time, trying to seek alliances from the community, to find collaborators, on a non-profit basis, to develop blockchain solutions for the South-east Asia small and medium enterprise. If the ideas are able to reach proof-of-concept, we can then develop them into for-profit business solutions. Any advice from you?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olifante picture olifante  路  3Comments

renatorib picture renatorib  路  3Comments

formula349 picture formula349  路  3Comments

kenji4569 picture kenji4569  路  3Comments

swrdfish picture swrdfish  路  3Comments