HMR -- can't find hot-update.json.
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
using:
zeit/next-sass
for mynext.config.js
- a custom
server.js
with a custom directoryconst application = next({ dev, dir: './src' });
- Flow js for type checking
- Redux and Apollo
I have just updated to next 6.0.0 and I can’t use my site because the HMR fails to find any information, causing any route requests to result in a full reload.
The site works when loaded with yarn build && yarn start
Folder structures:
./src
/pages
/apps
/Public
index.js
sign_in.js
sign_up.js
forgot_password.js
/Admin
.......
EDIT:
It seems like the files are supposed to go directly into .next
I see that happening in a small test repo that I made. However, it now seems that if that’s the case, the error I’m encountering is actually the fact that the HMR is unable to find the hot-update.json
files when updates are made.
END EDIT
When on page /apps/Public/sign_in
as /sign_in
I click on <Link to="/apps/Public/forgot_password" as="forgot_password" />
Result:
Initial page loads of all pages works perfectly. However, any route changes fail.
Debugging
I have tried just about everything I can think of. It seems like this error is caused from my ./src/.next
file not having a /webpack
directory. My understanding is that HMR will look for the hot-update.json
files in /webpack
However, in my case, all hot-update.json
files are in ./src/.next
Contents of ./src/.next
Questions:
- Why do I not have a
/webpack
directory? - I can’t create a reproduction repo, can someone from Zeit help by looking through my private repo?
Your Environment
Tech | Version |
---|---|
next | 6.0 |
node | 9.11.1 |
OS | Mac OS |
browser | Chrome |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (4 by maintainers)
Top GitHub Comments
@timneutkens Update: tried with canary, still same result. My guess its something to do with integrating to my the existing express app, but can’t quite figure out the issue.
After some more digging, I found that eventually the
hot-update
file does get written to disk, but only after something causes a change (building a new page, or old page is disposed). It seems like thehot-update.json
files on disk are always one step behind the file being requested from the client.I’m not too familiar with how
webpack-dev-middleware
works, but are the files supposed to be on disk before they can be served, or does the middleware serve them from memory? Trying to figure if maybe something is preventing them from being written to the disk at the right time.my guess would be that some of the environment variables are of significance, here’s a
process.env
dump done at the beginningnext.config.js
: