Skip to content

Adding eslint-loader stops hot-reloading #5363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
obetoferreira opened this issue Oct 2, 2018 · 5 comments · Fixed by #6099
Closed

Adding eslint-loader stops hot-reloading #5363

obetoferreira opened this issue Oct 2, 2018 · 5 comments · Fixed by #6099

Comments

@obetoferreira
Copy link

obetoferreira commented Oct 2, 2018

Bug report

Creating a custom _error.js in pages directory makes HMR stop working.
This behavior occurs even when using Next's official example, unless your _error.js file contains a single div, with no other imports.

To Reproduce

  1. Create any page (can be a simple index.js with "Hello, World!")
  2. Create a _error.js page, with the example provided in this repo
  3. Change index.js content
  4. Save file
  5. Wait for changes in the browser

Expected behavior

The window in the browser should update automatically.

System information

  • OS: macOS Sierra 10.12.6
  • Browser Chrome Version 69.0.3497.100 (Official Build) (64-bit)
  • Version of Next.js: 7.0.1

Additional context

When file saved:

  • The app logs "success server compiled" in the terminal

  • The app logs "[HMR] bundle rebuilding" in the browser's console
    But there is no changes.

  • The problem still occurs in 7.0.2-canary.5 version.

@obetoferreira
Copy link
Author

Jesus I was so wrong.

Actually, eslint-loader dependency is what makes HMR stop working.

For some reason, eslint warnings are webpack warnings (see webpack-contrib/eslint-loader#193). Although eslint-loader has the emitWarning: true param, it doesn't work as expected.

Just removed eslint-loader until this is resolved.

I'm not sure if this wrong behaviour has to do with next.js or webpack or eslint or eslint-loader community.

@timneutkens timneutkens changed the title Custom _error.js page stops hot reloading Adding eslint-loader stops hot-reloading Oct 17, 2018
@jstcki
Copy link
Contributor

jstcki commented Oct 30, 2018

For the record, this also happens when any other webpack warning occurs (e.g. from mini-css-extract-plugin).

@dima-f1
Copy link

dima-f1 commented Jan 12, 2019

Any update or workaround on this issue?

@obetoferreira
Copy link
Author

For now, i'm running ESLint before application start only. Also, i'm using some linter plugins to my code editor. Haven't checked if there is any updates to fix this.

@timneutkens
Copy link
Member

Solved in #6099

timneutkens added a commit that referenced this issue Jan 21, 2019
Fixes #5363

I noticed this happening when making some changes on the nextjs.org/learn app. Basically we didn't apply updates when a warning was emitted from webpack. This would cause issues for users using eslint-loader or similar too.
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants