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

gatsby develop doesn't detect changes and recompile when file changes are made #7

Closed
marcus-grant opened this issue Jan 21, 2018 · 2 comments
Assignees
Labels
bug Something isn't working integration

Comments

@marcus-grant
Copy link
Owner

Changes aren't being detected or acted on if they are and so no compilation happens when changes are made and completely removes most utility offered by the integrated dev-server.

@marcus-grant marcus-grant self-assigned this Jan 21, 2018
@marcus-grant marcus-grant added bug Something isn't working integration labels Jan 21, 2018
@marcus-grant
Copy link
Owner Author

marcus-grant commented Jan 21, 2018

Problem: This issue from the gatsby repo on github details some of the problem, and it appears that due to some internal logic with which route is given by default to the internal networking, localhost isn't used and so somehow file watching is ignored.

Solution: By specifying localhost as the hosting route, (and not specifying port because that breaks it as well) makes the dev server network as expected. Then to address the file watching issue, the chokidar repo suggests enforcing synchronous file watching, though more taxing on the system can enforce more reliable file watching. Enabling it in the script dev-server stored in the project root addresses this. Altogether there's two lines that make the script have the server working. Use the below command to start the dev server properly:

export CHOKIDAR_USEPOLLING=1
gatsby develop --host localhost

marcus-grant pushed a commit that referenced this issue Jan 22, 2018
- dev-server bash script runs dev server with chokidar env var...
  - this enforces syncrhonous file watching
  - more cpu & ram usage than without, but more reliable
- and enforces localhost as the dev server route making...
  - client connections for hot reloading more reliable
@marcus-grant
Copy link
Owner Author

Commit above fixes issue by creating an alternate bash script to run that properly starts the dev server and has it functioning as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration
Projects
None yet
Development

No branches or pull requests

1 participant