-
Notifications
You must be signed in to change notification settings - Fork 28
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
Cannot convert undefined or null to object - when some image nodes are null #68
Comments
Further to the above - we've changed the structure on MongoDB so that if there is no image on a mediaItem we put the following:
This hasn't solved the error. I am not sure where issue is coming from - but its certainly something to do with the plugin getting either a null or undefined node somehow. I've tested a fix in create-asset-nodes-from-data.js - which gets rid of the error gatsby-transformer-cloudinary/gatsby-node/create-asset-nodes-from-data.js from line 52
now we have no errors and build works. The plugin is functioning normally - I know the above edit is a hack - can someone perhaps comment and I'm happy to tidy this up with suggestions and do a pull request. |
Hi, sorry for the delayed response, the holiday happened. Thanks for reporting this use case. Taking a look at this, setting a fallback value for |
Totally understand. Same deal here re-holidays :) will do a PR asap |
This took a few months to happen - sorry people, hope this helps: #140 |
I have a feeling this is invalid from v3.0.0 since |
The plugin is functioning and we get graphQL nodes created from the Cloudinary images, however we get the following error:
This occurs in develop and build, in develop it will get past this error, but build fails.
We are adding an object for cloudinary with all the applicable data, but due to our database structure this object is occasionally null. For instance:
Currently the situation is that the plugin appears to be working ok - the above structure is how it looks before the plugin is working. These get replaced with the fixed/fluid image graphQL node and the plugin appears to be working fine. But it still produces the error above, which of course fails the build.
It would be good if this isn't an error! A warning at most, so long as it finds at least some useable objects that would seem to be sufficient. Unfortunately making changes to our DB is a little difficult, there may be a way round this with gatsby-node.js, but it would be good to see if there's a fix perhaps.
The text was updated successfully, but these errors were encountered: