Hi Reese @reese ,
Thank you so much for creating this plugin! π I was trying to use this in my Gatsby site, and was unfortunately running into few internal errors from the plugin.
This is my configuration for the gatsby plugin. I have ensured and validated from Gatsby's GraphQL explorer that the below fields exist correctly for nodes of type annotations
:
{
resolve: "gatsby-plugin-stork",
options: {
indexes: [
{
resolvers: {
annotations: {
url: node => node.fields.book_slug_path,
title: node => node.extracted_google_books_metadata.book_title,
contents: node => node.extracted_google_books_metadata.book_description,
}
},
filename: 'annotations.st'
}
],
theme: "dark",
}
}
And for some reason, i keep on running into this exception below - which seems related to this line:
ERROR #11321 PLUGIN
"gatsby-plugin-stork" threw an error while running the onPostBootstrap lifecycle:
Cannot set property 'title' of undefined
60 | var key = _ref6[0],
61 | resolveFunc = _ref6[1];
> 62 | acc[key] = resolveFunc(node);
| ^
63 | }, {});
64 | files.push(resolvedValues);
65 | }); // Serialize and write to TOML
File: node_modules/gatsby-plugin-stork/gatsby-node.js:62:38
TypeError: Cannot set property 'title' of undefined
I tried to oversimplify the config above to this subsequently, i.e, just hardcoded strings - and even then I'm running into the same exception as above. Surely if there was some issue with my nodes configuration above and if that might have been resulting in the exception above, then it should have succeeded here:
{
resolve: "gatsby-plugin-stork",
options: {
indexes: [
{
resolvers: {
annotations: {
url: node => "test1",
title: node => "test2",
contents: node => "test3",
}
},
filename: 'annotations.st'
}
],
theme: "dark",
}
},
Would really appreciate if you could help with this? If you need any other blob of local nodes or other related configs from my end for looking into this, please let me know.
Thanks! :)