Skip to content

Next.js dev server gets stuck after a while, requests just spin #10061

Closed
@mjm

Description

@mjm

Bug report

Describe the bug

When I run my Next.js app with now dev, after a while (on the order of minutes, definitely less than an hour) my requests to it will stop working.

To Reproduce

I'm not sure how to isolate this one. It happens all the time with this project https://github.com/mjm/courier-js but it's not an easy thing to get running for reproduction.

  1. Run now dev
  2. Work on the app, making changes to files, saving, and watching them hot reload in the browser
  3. Eventually, one of these changes will try to reload and will get stuck. The on-page indicator for a page compiling will be there and keep spinning continuously. Trying to refresh the page just causes the browser to try to load the page until it times out.

When I give up, I can hit Ctrl-C to try to kill the server, but if it's in this state, it can take a minute or two to actually get the message and quit.

Expected behavior

Continuing to make changes should keep working and trigger refreshes in the browser.

System information

  • OS: macOS Catalina, though I think this happened before upgrading too
  • Browser (if applies): I've seen in both Chrome and Safari
  • Version of Next.js: 9.1.7, has happened in earlier versions of Next 9 as well
  • Version of Now CLI: 16.7.3

Additional context

I feel like this could be TypeScript related, but I don't have any evidence. I'm on the latest release for that as well. I'm happy to try things that might help understand what's going on. The only thing I've seen in the log from now dev (or next dev I guess) is that it seems like when it gets in this state, it will stack up two or three "compiling ..." messages when there would otherwise be just one.

Metadata

Metadata

Assignees

Labels

WebpackRelated to Webpack with Next.js.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions