Skip to content
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

Reload webpack if needed #2076

Merged
merged 14 commits into from
Jun 6, 2017
Merged

Conversation

arunoda
Copy link
Contributor

@arunoda arunoda commented May 26, 2017

TODO

  • Make the code pretty
  • Do a stability test
  • Add an integration test case

We need to do this specially we removed a previously built page from the filesystem.
You can see this reload after webpack throws an error like this:

ModuleBuildError: Module build failed: Error: ENOENT: no such file or directory, open '/data/projects/learnnextjs-demo/pages/about.js'
      at runLoaders (/data/zeit/next.js/node_modules/webpack/lib/NormalModule.js:192:19)
      at /data/zeit/next.js/node_modules/loader-runner/lib/LoaderRunner.js:364:11
      at Array.<anonymous> (/data/zeit/next.js/node_modules/loader-runner/lib/LoaderRunner.js:200:19)
      at Storage.finished (/data/zeit/next.js/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:15)
      at ReadFileContext.<anonymous> (/data/zeit/next.js/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:69:9)
      at ReadFileContext.callback (/data/zeit/next.js/node_modules/graceful-fs/graceful-fs.js:78:16)
      at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:336:13)

@rauchg rauchg merged commit 937d0e2 into vercel:master Jun 6, 2017
@arunoda arunoda changed the title [WIP] Reload webpack if needed Reload webpack if needed Jun 6, 2017
@arunoda arunoda deleted the reload-webpack-if-needed branch June 6, 2017 22:33
xuezhma pushed a commit to xuezhma/next.js that referenced this pull request Jun 22, 2017
* Reload webpack via hot-reloader when needed.
We need to do this specially we removed a previosly
built page from the filesystem.

* Make sure reloading is happen only once

* Reload only if there's a missing page error.

* Remove debug logs.

* 2.4.2

* Refactor the codebase a bit.

* Move some commonly used regexp to a utils module.

* Handle the reloading well when there's a custom error page.

* Add a HMR test case.

* Close the browser in the test case.
@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
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 this pull request may close these issues.

2 participants