"Module parse failed" running next dev in 8.1.1-canary.28
See original GitHub issueBug report
Describe the bug
Running next dev in my project is causing a Module parse failed: Unexpected token error when trying to compile next/dist/client/next-dev.js:
Module parse failed: Unexpected token (19:6)
You may need an appropriate loader to handle this file type.
|
|
> import('./noop'); // Support EventSource on Internet Explorer 11
|
| if (!window.EventSource) {
To Reproduce
My babel configuration is:
{
presets: [
[
'next/babel',
{
'preset-env': {
useBuiltIns: 'usage',
},
},
],
'@babel/preset-typescript'
],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
]
}
I can reproduce even when my next.config.js does not modify the webpack config.
Expected behavior
Compilation should succeed
System information
- Version of Next.js: 8.1.1-canary.28
Additional context
This is in a Yarn workspace–using monorepo, so the next package gets installed in a node_modules that’s a few directories up from where my source is.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
"Module parse failed" running next dev in 8.1.1-canary.28 #7344
Bug report Describe the bug Running next dev in my project is causing a Module parse failed: Unexpected token error when trying to...
Read more >Webpack in NextSJ Config - ModuleParseError: Module parse ...
I getting error while building from nextjs app or starting server with yarn dev command. This is next.config.js. it was work correctly until ......
Read more >8.1.1-canary.70 - next - npm
Start using next in your project by running `npm i next`. There are 2736 other projects in the npm registry using next.
Read more >Package Diff: next @ 8.1.1-canary.25 .. 8.1.1-canary.28
Visual diff of the npm package 'next' comparing 8.1.1-canary.25 with 8.1.1-canary.28.
Read more >Next NPM | npm.io
Next.js is a minimalistic framework for server-rendered React applications. ... and then just run npm run dev and go to http://localhost:3000 .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This seems to be the case for now, although we have prioritized #6940 I’m gonna close this issue in favor of the mentioned one, if you have any additional information that you think is helpful feel free to add it to that thread.
Awesome thanks 🙏, by included I mean when you add the
next/babelit already adds@babel/preset-typescript