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

gatsny build fails at: Building static HTML for pages failed with #11841

Closed
zilahir opened this issue Feb 17, 2019 · 5 comments
Closed

gatsny build fails at: Building static HTML for pages failed with #11841

zilahir opened this issue Feb 17, 2019 · 5 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: awaiting author response Additional information has been requested from the author status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.

Comments

@zilahir
Copy link
Contributor

zilahir commented Feb 17, 2019

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

See image attachment.
screen shot 2019-02-17 at 23 23 04

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.

#3094

I hace created a gist and put my entire json which probably causing the issue

@gurpreet-hanjra
Copy link
Contributor

hello @zilahir could you provide a minimal reproduction of the issue, maybe a github repo?

@zilahir
Copy link
Contributor Author

zilahir commented Feb 18, 2019

hello @gurpreet-hanjra , thank for your reply. well i can give u a github repo, but then i'd need to provide you my API credentials, since you won't be able to test it without those. I will figure out something soonish!

Thank you!

@gurpreet-hanjra
Copy link
Contributor

Great, thank you.

@gurpreet-hanjra gurpreet-hanjra added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. status: awaiting author response Additional information has been requested from the author labels Feb 18, 2019
@wardpeet
Copy link
Contributor

wardpeet commented Feb 18, 2019

@zilahir you could also mock the API with a JSON file as I'm pretty sure it's not really Gatsby related but more on the data part of it. So if you could reproduce it with maybe something like below that would be enough :)

const demo = JSON.parse(`your response`);

return demo.map((e, i) => (`

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 11, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 11, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: awaiting author response Additional information has been requested from the author status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting.
Projects
None yet
Development

No branches or pull requests

3 participants