We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent deb6652 commit c63dbb8Copy full SHA for c63dbb8
packages/gatsby/src/commands/develop.js
@@ -220,6 +220,14 @@ async function startServer(program) {
220
221
await apiRunnerNode(`onCreateDevServer`, { app })
222
223
+ // In case nothing before handled hot-update - send 404.
224
+ // This fixes "Unexpected token < in JSON at position 0" runtime
225
+ // errors after restarting development server and
226
+ // cause automatic hard refresh in the browser.
227
+ app.use(/.*\.hot-update\.json$/i, (req, res) => {
228
+ res.status(404).end()
229
+ })
230
+
231
// Render an HTML page and serve it.
232
app.use((req, res, next) => {
233
res.sendFile(directoryPath(`public/index.html`), err => {
0 commit comments