Following the README.md instructions to run a next.js project, but create the project's folder in a subfolder which starts with a "."
Changing the text in index.js should initiate a recompile which is reflected in the browser.
Next never recompiles after change are made to index.js. Must ctrl+c to quit, then run npm run dev again.
Please review video here: https://www.youtube.com/watch?v=HfOiCxw6bKw&feature=youtu.be
note that the project is running out a folder ".nosync" (because of this: https://discussions.apple.com/thread/6811420?start=0&tstart=0)
Simply trying out next. basic HMR is not working correctly.
| Tech | Version |
|---------|---------|
| next |^4.1.3|
| node |8.7.0|
| OS |OSX 10.13|
| browser |Chrome 61|
| etc |npm 5.4.2|
I have done a simple test to reproduce the issue and using the following steps:
export default () => <div>Hello You</div>)npm run dev on ~/next-tests/.hidden/testpages/index.js and saveNow if I rename the folder to ~/next-tests/not-hidden/test then HMR works properly.
This seems to be related to this line https://github.com/zeit/next.js/blob/canary/server/hot-reloader.js#L177 the regex is ignoring any path with a /.
I ran into this problem when I downloaded Next for the first time! Very annoying and almost caused me to walk away. Glad I stuck with it, and I decided to give this another look now :+1:
I've created a PR with more info #4589
This simple change seems to work for me:
const ignored = [
'**/.*',
'node_modules'
]
Most helpful comment
I have done a simple test to reproduce the issue and using the following steps:
export default () => <div>Hello You</div>)npm run devon~/next-tests/.hidden/testpages/index.jsand saveNow if I rename the folder to
~/next-tests/not-hidden/testthen HMR works properly.