-
Notifications
You must be signed in to change notification settings - Fork 434
Closed
Labels
type: bugcode to address defects in shipped codecode to address defects in shipped code
Description
Describe the bug
Since version 10, using netlify-cli in a Gatsby project and serving the site in develop mode locally using netlify dev seems to break React Fast Refresh/hot reloading in the browser. Hot reloading still works fine when browsing the site via the underlying Gatsby dev server instead of netlify-cli's.
Expected behavior
Making a change to a React component in the source code automatically updates the rendered markup on the website in local develop mode, thanks to React Fast Refresh/hot reloading.
Observed behavior
When accessing the local develop site via netlify-cli's dev server (i.e., via localhost:8888 rather than localhost:8000) hot reloading does not work at all.
Steps to reproduce
- Clone this minimal reproduction repo, and run
npm install. - Run
npm startto start thenetlify-clidev server. - Change something, like JSX, in
src/pages/index.js. - Observe that it does not hot-reload in the browser.
- Browse to
http://localhost:8000(the underlying Gatsby dev server). - Try again; observe that Fast Refresh is working fine.
- Downgrade to
netlify-cli@^9. - Browse to
http://localhost:8888(thenetlify-clidev server). - Try again; observe that Fast Refresh is working fine.
Configuration
Bug is demonstrable with zero config.
Environment
System:
OS: macOS 12.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 88.89 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.18 - /opt/homebrew/bin/yarn
npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
npmPackages:
netlify-cli: ^10.1.0 => 10.1.0laurentlaporte, tasandberg, Quentin-Danjou and easydatasolution
Metadata
Metadata
Assignees
Labels
type: bugcode to address defects in shipped codecode to address defects in shipped code