Gatsby development server stops on every syntax error
Asked Answered
T

1

6

Any type of syntax error or code as I'm developing will cause my dev server to stop.

I'm simply running an npm start that's setup with this

GATSBY_ACTIVE_ENV=development gatsby develop

I get a message on any syntax error:

Failed to validate error [Error [ValidationError]: "location.start.index" is not allowed:
....
....
{ 
  message: '"location.start.index" is not allowed',
  path: [Array],
  type: 'object.unknown',
  context: [Object] 
}

failed Re-building development bundle - 0.714s

Is there any obvious things to check? I'm running from within vscode . I would expect the dev server to not fail on any syntax error

Tailspin answered 17/3, 2022 at 3:1 Comment(2)
Have you tried updating to the latest version of Gatsby? I had been having the same problem for quite some time. Today, I realized I hadn't upgraded in a while. I went from 4.5.4 to 4.10.3 and the problem seems to have gone away for the time being 🤞. (I also updated all my gatsby extensions to the latest versions.)Gaekwar
Did you ever figure this out? I'm seeing the same thing. I'm on gatsby 3 and I'm not ready to make the jump to v4 yet.Shaffer
I
1

This usually indicates there is an error in one of the component files of your application. There should another message located above this pointing to the particular file and line that is causing the issue. VS Code may not identify these and will cause the Gatsby compiler to fail. This is what was throwing mine.

 text: 'Generating development SSR bundle failed\n' +
      '\n' +
      "...chartStyleBox.js: Identifier 'styleBox' has already been declared. (41:14)\n" +
      '\n' +
Indiscrimination answered 4/11, 2022 at 17:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.