Next.js: Next.js Learn E2-lazy-loading-modules build issue

Created on 21 Apr 2019  Â·  4Comments  Â·  Source: vercel/next.js

Examples bug report

Example name

Lazy Loading Modules
https://github.com/zeit/next-learn-demo.git
Step : E2-lazy-loading-modules

Describe the bug

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

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:
npm install
npm run dev

Expected behavior

The app starts on port 3000

Screenshots

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)

System information

  • OS: Windows 10
  • Version of Next.js: 8.0.3 (https://github.com/zeit/next-learn-demo.git)

Additional context

The same issue is in the E3 example as well and cannot proceed further in the tutorial.

Most helpful comment

I had another issue in the E2 example when I changed the requires to await imports. I was able to get around this by deleting node_modules and package-lock.json, then do yarn install (rather than npm install)

All 4 comments

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 requires to await imports. 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renatorib picture renatorib  Â·  3Comments

wagerfield picture wagerfield  Â·  3Comments

olifante picture olifante  Â·  3Comments

kenji4569 picture kenji4569  Â·  3Comments

knipferrc picture knipferrc  Â·  3Comments