Next.js: Stuck / Hanging on Compiling

Created on 3 Oct 2019  路  6Comments  路  Source: vercel/next.js

Bug report

Describe the bug

For some reason, I can't seem to get next page to load when the pages folder is in a different directory. I'm not sure at what point the code is hanging on.

To Reproduce

  1. Clone or download repository
  2. yarn install in server and web folder
  3. yarn run dev in server folder
  4. Go to localhost:3000
  5. Terminal will show it's compiling and won't load page

Expected behavior

Hoping to load to the hello world page when browsing localhost:3000.

System information

  • OS: macOS
  • Browser: chrome, firefox
  • Version of Next.js: ^9.0.8-canary.2
good first issue needs investigation

Most helpful comment

Running Ran into this on 9.1.1 for this project: https://github.com/openmultiplayer/homepage/ (master branch)

In case anyone else runs into this, the following may help:

To debug the issue, I ran next build and sure enough, an actual error appeared that wasn't present during next (dev):

Error: > Build failed because of webpack errors

The error was a missing module Module not found: Error: Can't resolve 'url-loader' which was somehow lost during a prune/update/shuffle of our deps and tooling.

Strange how this wasn't surfaced during the dev build but definitely good to know that running next build can surface issues invisible during dev.

All 6 comments

Figured it out. Needed to add eslint-loader as a dependency and move babel around.

Running Ran into this on 9.1.1 for this project: https://github.com/openmultiplayer/homepage/ (master branch)

In case anyone else runs into this, the following may help:

To debug the issue, I ran next build and sure enough, an actual error appeared that wasn't present during next (dev):

Error: > Build failed because of webpack errors

The error was a missing module Module not found: Error: Can't resolve 'url-loader' which was somehow lost during a prune/update/shuffle of our deps and tooling.

Strange how this wasn't surfaced during the dev build but definitely good to know that running next build can surface issues invisible during dev.

Thanks @Southclaws. I wouldn't have known how to debug my issue if I didn't see your response. Any way to fix this in dev??

Just make sure your dependencies are satisfied and run next build, after that the dev script should work again. Not sure if anything else causes this though.

i just tested your method: next build >> next dev

but 3001 port still has infinite loop and my project does not have any output .any other solution ???

Solved!!!!

  1. delete node-modules
  2. delete package-lock.json
  3. npm run build (receive webpack error )
  4. npm run dev
  5. hooray
Was this page helpful?
0 / 5 - 0 ratings