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

Gatsby develop only works first time #3

Closed
skrapkam opened this issue Jan 17, 2019 · 4 comments
Closed

Gatsby develop only works first time #3

skrapkam opened this issue Jan 17, 2019 · 4 comments

Comments

@skrapkam
Copy link

Similar issue to what's going on here: gatsbyjs/gatsby#11109

When I run Gatsby develop I get this error:

Error: Invariant Violation: Encountered an error trying to infer a GraphQL typ  e for: "localImage___NODE". There is no corresponding node with the id field m  atching: "ec07e826-36d4-5377-bec9-d9cefe92acb5"

  - invariant.js:40 invariant
    [samchang]/[invariant]/invariant.js:40:15

  - infer-graphql-type.js:234 validateLinkedNode
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:234:5

  - infer-graphql-type.js:293 inferFromFieldName
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:293:3

  - infer-graphql-type.js:359 _.each
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:359:23

  - lodash.js:4911
    [samchang]/[lodash]/lodash.js:4911:15

  - lodash.js:2996 baseForOwn
    [samchang]/[lodash]/lodash.js:2996:24

  - lodash.js:4880
    [samchang]/[lodash]/lodash.js:4880:18

  - lodash.js:9344 Function.forEach
    [samchang]/[lodash]/lodash.js:9344:14

  - infer-graphql-type.js:338 _inferObjectStructureFromNodes
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:338:5

  - infer-graphql-type.js:409 inferObjectStructureFromNodes
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:409:10

  - build-node-types.js:138 inferFields
    [samchang]/[gatsby]/dist/schema/build-node-types.js:138:26

  - build-node-types.js:187 fields
    [samchang]/[gatsby]/dist/schema/build-node-types.js:187:19

  - Array.forEach

  - Array.forEach


error UNHANDLED REJECTION


  Error: Invariant Violation: Encountered an error trying to infer a GraphQL typ  e for: "localImage___NODE". There is no corresponding node with the id field m  atching: "ec07e826-36d4-5377-bec9-d9cefe92acb5"

  - invariant.js:40 invariant
    [samchang]/[invariant]/invariant.js:40:15

  - infer-graphql-type.js:234 validateLinkedNode
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:234:5

  - infer-graphql-type.js:293 inferFromFieldName
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:293:3

  - infer-graphql-type.js:359 _.each
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:359:23

  - lodash.js:4911
    [samchang]/[lodash]/lodash.js:4911:15

  - lodash.js:2996 baseForOwn
    [samchang]/[lodash]/lodash.js:2996:24

  - lodash.js:4880
    [samchang]/[lodash]/lodash.js:4880:18

  - lodash.js:9344 Function.forEach
    [samchang]/[lodash]/lodash.js:9344:14

  - infer-graphql-type.js:338 _inferObjectStructureFromNodes
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:338:5

  - infer-graphql-type.js:409 inferObjectStructureFromNodes
    [samchang]/[gatsby]/dist/schema/infer-graphql-type.js:409:10

  - build-node-types.js:138 inferFields
    [samchang]/[gatsby]/dist/schema/build-node-types.js:138:26

  - build-node-types.js:187 fields
    [samchang]/[gatsby]/dist/schema/build-node-types.js:187:19

  - Array.forEach

  - Array.forEach

But when I delete the cache folder and run Gatsby develop again or completely stopped running Gatsby-source-Instagram-all things seem to work.

@MantasMikal
Copy link
Owner

MantasMikal commented Jan 18, 2019

Hey @skrapkam,
I am aware of the problem, but I am not able to reproduce the bug consistently. Also, it appears that this happens only when running on a local development server because running it on Netlify works fine.
Although I am not entirely sure why this is happening, but it might be as @polarathene pointed out in gatsbyjs/gatsby#11109 - that the connection fails to fetch some assets and its childImageSharp data is empty/null, thus producing the error. I am not sure how can check I whether the download of the asset was complete or not, but I'll try to look at this and figure something out. Let me know if you have any ideas :)

@skrapkam
Copy link
Author

I am aware of the problem, but I am not able to reproduce the bug consistently. Also, it appears that this happens only when running on a local development server because running it on Netlify works fine.

Yep, running on Netlify is totally fine for me. It's not that big of deal... just deleting cache folder over and over again is a bit of a hassle 😆

Thanks for taking a look!

@MantasMikal
Copy link
Owner

I am aware of the problem, but I am not able to reproduce the bug consistently. Also, it appears that this happens only when running on a local development server because running it on Netlify works fine.

Yep, running on Netlify is totally fine for me. It's not that big of deal... just deleting cache folder over and over again is a bit of a hassle 😆

Thanks for taking a look!

Just add this to your package.json
"startrm": " rmdir /s /q .cache && gatsby develop" will save you some time :D

@skrapkam
Copy link
Author

I think the new plugin update fixes this issue? Can probably close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants