Cache issues with uploaded images
darioghilardi opened this issue · comments
Hello,
thanks a lot for the effort you put into this plugin.
I stumbled upon what I think is a little bug with images, these are the steps to reproduce the issue:
- Upload an image to a Notion page (don't use one from Unsplash, upload one from your computer).
yarn start
- It works
- Restart the server
- Error:
Invariant Violation: Encountered an error trying to infer a GraphQL type for: localFile__ _NODE. There is no corresponding node with the id field matching: "4b8e0ad5-41c1-5781-bff6-ee4 c4deeed6b".
It seems the cache for Gatsby nodes is stepping in and is messing up with node ids. If I clean the cache between runs I don't get the error.
Good catch. Will look into that. Thanks!
My knowledge of Gatsby internals is limited, but I found this fix that has been applied to gatsby-source-contentful
and it seems to work also here.
I will try to submit a PR.