question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Just getting compiler errors when starting a new project

See original GitHub issue

Bug report

Describe the bug

I am new to next.js (because I searched for a lightweight non-agnostic alternative to meteor for a small side-project). However, I try to create a new Project (the final project will have 2 Pages and 2 express API Endpoints) but I always get a compiler error when trying to start next.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a new Next Project (either doing the tutorial or by create-next-app)
  2. Start the dev server with npm run dev
  3. See Compiler Errors (looks like issues with ES6)

Expected behavior

The Tutorial explains how to get a minimal running project.

Screenshots

[keller@bkt testapp] npm run dev

> testapp@1.0.0 dev /home/myuser/repos/testapp
> next

/home/myuser/repos/testapp/node_modules/next/dist/bin/next:31
    build: async () => await Promise.resolve().then(() => __importStar(require('../cli/next-build'))).then((i) => i.nextBuild),
                 ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testapp@1.0.0 dev: `next`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the testapp@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2019-05-15T13_38_44_069Z-debug.log

System information

  • OS: Linux (4.18.16-arch1-1-ARCH)
  • Browser didn’t come that far
  • Version of Next.js: 8.0.4, 8.1.0
  • Node Version: 6.11.2

Additional context

I will try doing a node update first. If it has to do with the node version, it is a documentation bug. If not, it is some other weired bug.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kellertobiascommented, May 16, 2019

In my opinion, this should be stated in the first page of the tutorial, that you check your node version. Many os do have node in their package management and these versions could be outdated.

Frameworks that advertise, that they are easy to use should not crash when starting without any helpful message.

Tim Neutkens notifications@github.com schrieb am Do., 16. Mai 2019, 11:34:

@Janpot https://github.com/Janpot

Didn’t npm print a warning when you installed next?

Actually because of using an older version of node, probably an older version of npm was also used which might not have these checks 😭

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zeit/next.js/issues/7342?email_source=notifications&email_token=ABU6ODTHAQ4RQHF7YR5LNALPVUTDPA5CNFSM4HNDPMSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVRH5TI#issuecomment-492994253, or mute the thread https://github.com/notifications/unsubscribe-auth/ABU6ODWGITTRX3SYWYY63TDPVUTDPANCNFSM4HNDPMSA .

1reaction
timneutkenscommented, May 16, 2019

@janpot

Didn’t npm print a warning when you installed next?

Actually because of using an older version of node, probably an older version of npm was also used which might not have these checks 😭

Read more comments on GitHub >

github_iconTop Results From Across the Web

compilation error while creating new project. 2021.1.20f1
I downloaded Unity 2021.1.20f1 and tried to create a new project, but then a error pops up saying "The project you are opening...
Read more >
Why do I get compile errors in every project, even new ones ...
this may be a little different for your project but solution to this is really simple, Open up package manager from Windows->Package manager ......
Read more >
Compile error in new project - Unity Forum
I started a new project in 2020LTS and get 2 errors when the project is first built, before I add any assets or...
Read more >
Just getting compiler errors when starting a new project #7342
Start the dev server with npm run dev; See Compiler Errors (looks like issues with ES6). Expected behavior. The Tutorial explains how to...
Read more >
The Project you are opening contains compilation errors fix
0:00 · New ! Watch ads now so you can enjoy fewer interruptions. Got it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found