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

Exception reading one JSON file shouldn't prevent all JSON files from being processed. #14

Open
macdonst opened this issue Aug 13, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@macdonst
Copy link
Contributor

Expected Behaviour

Only invalid JSON files should not be processed.

Actual Behaviour

The first invalid JSON file found prevents all others from being processed

Reproduce Scenario (including but not limited to)

Steps to Reproduce

  • Add an empty file like sample.json in your content repo.
  • Run gatsby develop

Platform and Version

Current main branch.

Sample Code that illustrates the problem

Logs taken while reproducing problem

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/gatsby-node.js:108:29
    at Array.forEach (<anonymous>)
    at readManifest (/apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/gatsby-node.js:106:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.exports.createPages (/apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/gatsby-node.js:200:17)
    at async runAPI (/apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/node_modules/gatsby/dist/utils/api-runner-node.js:302:16)
Could not read the manifest
Skipping JSON files
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/gatsby-node.js:275:29
    at Array.forEach (<anonymous>)
    at Object.exports.createPages (/apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/gatsby-node.js:273:30)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async runAPI (/apps/jenkins/2.235.2/workspace/storage-api-HaZqYDZi/node_modules/gatsby/dist/utils/api-runner-node.js:302:16)
error "gatsby-node.js" threw an error while running the createPages lifecycle:
@macdonst macdonst added the bug Something isn't working label Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant