Comments (5)
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:
mediaItems: [
{
"cloudinary": {
"cloudinaryAssetData": false
}
}
]
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
function getAssetDataPaths({ node, basePath = '' }) {
// const currentNode = basePath === '' ? node : get(node, basePath);
// cheeky edit:
let currentNode = basePath === '' ? node : get(node, basePath);
if(currentNode === null || currentNode === undefined ){
currentNode = {}
}
const directAssetDataPaths = Object.keys(currentNode)
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.
from gatsby-transformer-cloudinary.
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 currentNode
works, could you send a PR for this?
from gatsby-transformer-cloudinary.
Totally understand. Same deal here re-holidays :)
will do a PR asap
from gatsby-transformer-cloudinary.
This took a few months to happen - sorry people, hope this helps: #140
from gatsby-transformer-cloudinary.
I have a feeling this is invalid from v3.0.0 since cloudinaryAssetData
is no longer in use.
from gatsby-transformer-cloudinary.
Related Issues (20)
- Initiate global state in a multiple versions compatible way HOT 2
- Bundling External Files in a Gatsby v4 compatible way HOT 1
- ERROR Type with name "RemoteFileResize" does not exists HOT 4
- Add contributing docs, license and code of conduct HOT 1
- Validate configured options using `pluginOptionsSchema` HOT 1
- Add automated test and release process using Semantic Release HOT 2
- Remove support for deprecated gatsby-image HOT 2
- Rework README.md HOT 1
- Rework demo HOT 3
- `gatsbyImageData` generates `http` urls, not `https` HOT 2
- Error [ValidationError]: "error" must be of type object HOT 9
- Gatsby v5 support HOT 2
- TypeError: Cannot read properties of undefined (reading 'width') HOT 4
- Add custom analytics code for generated Cloudinary URLs HOT 5
- Cannot query gatsbyImageData via Cloudinary app on Contentful HOT 6
- warning [gatsby-transformer-cloudinary] No metadata for ... gatsbyImageData will resolve to null HOT 4
- How to upload local image to Cloudinary during Gatsby build
- Make the Contributing.md hacktoberfest ready HOT 7
- Make the Plugin Support Cloudinary Assets Sourced Via CMSs HOT 2
- Rewrite README to explain how to add Gatsby image support to Cloudinary image data sourced from Sanity CMS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-transformer-cloudinary.