GrappleGQL / gatsby-source-wagtail

Plugin for sourcing Gatsby data from Wagtail CMS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`createWagtailPages` breaks hot reloading

tbrlpld opened this issue · comments

Hi,

I am currently experiencing issues with the hot reloading. When I integrate a call to the createWagtailPages function in the gatsby-node.js file, then hot reloading stops working after I introduce a small bug (i.e. a syntax error like a missing closing tag). The hot reloading does pick up on the error and shows the appropriate message. When I then fix the error, hot reloading does not work anymore. The error message remains. Trying to reload the page results in a timeout (or at least takes so long that it seems infinite).

Was wondering if you can reproduce this behavior?

I am currently on the version from master.

System info:

$ gatsby info

  System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.3.1 - ~/.nvm/versions/node/v12.3.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.7 - ~/.nvm/versions/node/v12.3.1/bin/npm
  Languages:
    Python: 3.8.2 - /Users/tibor/.pyenv/shims/python
  Browsers:
    Chrome: 86.0.4240.80
    Firefox: 81.0.1
    Safari: 14.0
  npmPackages:
    gatsby: 2.24.51 => 2.24.51
    gatsby-source-wagtail: git+https://github.com/GrappleGQL/gatsby-source-wagtail.git => 0.5.1
    gatsby-transformer-sharp: ^2.5.17 => 2.5.17
  npmGlobalPackages:
    gatsby: 2.24.67

I do sometimes see this error in the console:

EventSource cannot load http://localhost:9000/__webpack_hmr due to access control checks.

(My dev server is running 9000 because the backend is already on 8000)

I am now noticing that the hot reloading also breaks without an error being created. Any change in the code (with or without creating an error) leads to the issue. So really I can load the page and reload it without issue. But as soon as I am changing something in the code, then I can not load the page anymore and need to restart the server.

EDIT:
To clarify a bit more, when a non-breaking change is made, then the browser seems to successfully reload the changes automatically. But, trying to manually reload the page does not work anymore.