-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Labels
stale?Issue that may be closed soon due to the original author not responding any more.Issue that may be closed soon due to the original author not responding any more.status: awaiting author responseAdditional information has been requested from the authorAdditional information has been requested from the authorstatus: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.This issue needs a simplified reproduction of the bug for further troubleshooting.
Description
Description
I have been struggling with this for weeks now.
gatsby develop works as expected, all the data getting processed, all the pages rendered correctly, but gatsby build fails with the following issue:
error Building static HTML for pages failed
SyntaxError: Unexpected end of JSON input
- JSON.parse
Steps to reproduce
get any api endpoint which returns json like as string, then use:
let demo = JSON.parse(sometJson),
then try to map it through:
demo.map((e, i) => (
In dev, works like charm, as it should. The issues occurs when i am trying to build.
Expected result
Not throwing unexpected end of json input
Actual result
Environment
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.4 - /usr/local/bin/node
npm: 5.6.0 - /usr/local/bin/npm
Browsers:
Chrome: 72.0.3626.109
Firefox: 65.0
Safari: 12.0.3
npmPackages:
gatsby: ^2.0.76 => 2.0.76
gatsby-image: ^2.0.20 => 2.0.25
gatsby-plugin-manifest: ^2.0.9 => 2.0.12
gatsby-plugin-offline: ^2.0.16 => 2.0.20
gatsby-plugin-react-helmet: ^3.0.2 => 3.0.5
gatsby-plugin-sass: ^2.0.7 => 2.0.7
gatsby-plugin-sharp: ^2.0.14 => 2.0.16
gatsby-source-filesystem: ^2.0.8 => 2.0.12
gatsby-transformer-sharp: ^2.1.8 => 2.1.9
npmGlobalPackages:
gatsby-cli: 2.4.7
I have found an other issue which may be related, but that one was already closed, even if the issue seems super similar.
I hace created a gist and put my entire json which probably causing the issue
Metadata
Metadata
Assignees
Labels
stale?Issue that may be closed soon due to the original author not responding any more.Issue that may be closed soon due to the original author not responding any more.status: awaiting author responseAdditional information has been requested from the authorAdditional information has been requested from the authorstatus: needs reproductionThis issue needs a simplified reproduction of the bug for further troubleshooting.This issue needs a simplified reproduction of the bug for further troubleshooting.
