-
Notifications
You must be signed in to change notification settings - Fork 39
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
Broken with Gatsby 2.18.0 #28
Comments
I was pulling my hair out, because I have the exact same thing. My |
Seeing the same thing. Downgrading to 2.17, it works just fine. |
This seems related to gatsbyjs/gatsby#19092. I did some debugging of this plugin and cc @vladar |
Sorry to see this change broke this plugin. But looks like this plugin is doing direct node mutation in gatsby-plugin-remote-images/src/gatsby-node.js Lines 72 to 76 in 649abaa
There is a separate action for situations when you need adding a field to a node: createNodeField. A quote from docs:
But a better way to declare a foreign key relationship on a node would be using schema customization APIs (Gatsby will probably shift towards this way of customizing types in future and deprecate old inference tricks eventually). I think exports.createResolvers = ({ createResolvers }) => {
const resolvers = {
[nodeType]: {
[fieldName]: {
type: "File",
resolve(source, args, context, info) {
return context.nodeModel.getNodeById(source.parentNodeId)
},
},
},
}
createResolvers(resolvers)
} Hope it helps! |
@vladar I don't know that the direct node manipulation is necessarily the issue the root issue. I am also getting errors related to the Related PR that breaks on ^2.18.0: jbolda/gatsby-source-airtable#117 |
@jbolda Your link points to I did a quick sanity check - added: console.log(`create node `, row.id ,` data: `, Object.keys(node.data)) before this And turns out that the field There might be some race condition that didn't manifest itself before the schema rebuilding PR but shows up now. So to summarize this - it is likely a mutation issue. Does it help? |
whew! Downgrading helped. For reference gatsby-config.js
gatsby-node.js
Not sure if that helps. I'm super grateful for this plugin. |
@vladar It looks like it was actually the ref: jbolda/gatsby-source-airtable@7d84a2d Looking at this plugin, it does make the mutations directly on the node, as pointed out, which is likely the issue here. All promises are |
hi totally new to gatsby -- just out of curiosity how do I downgrade back to 2.7? I tried
on my site, i still end up with 2.8.14 tks |
You’re changing the gatsby installation that lives globally on your computer (that’s what the -g flag does). Instead, you want to change the gatsby installation specific to your project. So, navigate your console to your project folder and run |
thanks @ooloth! that solved my image issue. tks |
You can also update to |
thanks for the suggestion @wKovacs64. I will look into this after I run through my work with the project. tks |
just spent a good 4 hours trying to figure out what was wrong with my local plugin that used |
Sorry all, for some reason I was not getting my Github notifications on this! 😅 If there is a PR that can improve this plugin to make the move long term to use the |
Long term fix in PR here by @wKovacs64 . |
Something seems to have changed in Gatsby
2.17.17 -> 2.18.0
that impacts this plugin. I'm no longer seeing the node created. Confirmed missing via GraphiQL, and the build error is as follows:CodeSandbox Reproduction
The text was updated successfully, but these errors were encountered: