Lazy Loading Modules
https://github.com/zeit/next-learn-demo.git
Step : E2-lazy-loading-modules
npm run dev causes runtime issues and the server does not start. Faces the same issue with E3 as well.
I am using Windows 10 for the tutorials
Steps to reproduce the behavior, please provide code snippets or a repository:
npm install
npm run dev
The app starts on port 3000
If applicable, add screenshots to help explain your problem.
C:\workspace\next-learn-demo\E2-lazy-loading-modules>npm run dev
> [email protected] dev C:\workspace\next-learn-demo\E2-lazy-loading-modules
> node server.js
[ error ] ./node_modules/next/dist/client/next-dev.js 36:6
Module parse failed: Unexpected token (36:6)
You may need an appropriate loader to handle this file type.
|
|
> import('./noop'); // Support EventSource on Internet Explorer 11
|
| if (!window.EventSource) {
> Ready on http://localhost:3000
TypeError: Cannot read property 'issuer' of null
at findEntryModule (C:\workspace\next-learn-demo\E2-lazy-loading-modules\node_modules\next\dist\server\hot-reloader.js:60:16)
at erroredPages (C:\workspace\next-learn-demo\E2-lazy-loading-modules\node_modules\next\dist\server\hot-reloader.js:68:29)
at HotReloader.getCompilationErrors (C:\workspace\next-learn-demo\E2-lazy-loading-modules\node_modules\next\dist\server\hot-reloader.js:308:33)
at process._tickCallback (internal/process/next_tick.js:68:7)
TypeError: Cannot read property 'issuer' of null
at findEntryModule (C:\workspace\next-learn-demo\E2-lazy-loading-modules\node_modules\next\dist\server\hot-reloader.js:60:16)
at erroredPages (C:\workspace\next-learn-demo\E2-lazy-loading-modules\node_modules\next\dist\server\hot-reloader.js:68:29)
at HotReloader.getCompilationErrors (C:\workspace\next-learn-demo\E2-lazy-loading-modules\node_modules\next\dist\server\hot-reloader.js:308:33)
at process._tickCallback (internal/process/next_tick.js:68:7)
The same issue is in the E3 example as well and cannot proceed further in the tutorial.
I'm getting the same issue on MacOS:
➜ E2-lazy-loading-modules git:(master) npm run dev
> [email protected] dev /Users/morcs/code/next-learn-demo/E2-lazy-loading-modules
> node server.js
[ error ] ./node_modules/next/dist/client/next-dev.js 36:6
Module parse failed: Unexpected token (36:6)
You may need an appropriate loader to handle this file type.
|
|
> import('./noop'); // Support EventSource on Internet Explorer 11
|
| if (!window.EventSource) {
If I comment out line 36 of next-dev.js It starts working
import('./noop'); // Support EventSource on Internet Explorer 11
I had another issue in the E2 example when I changed the require
s to await import
s. I was able to get around this by deleting node_modules
and package-lock.json
, then do yarn install
(rather than npm install
)
Duplicate of #6240
@morcs Thank you .. using the steps you mentioned did the trick for me as well.
Most helpful comment
I had another issue in the E2 example when I changed the
require
s toawait import
s. I was able to get around this by deletingnode_modules
andpackage-lock.json
, then doyarn install
(rather thannpm install
)