Code Monkey home page Code Monkey logo

Comments (5)

amcc avatar amcc commented on May 29, 2024

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.

Chuloo avatar Chuloo commented on May 29, 2024

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.

amcc avatar amcc commented on May 29, 2024

Totally understand. Same deal here re-holidays :)

will do a PR asap

from gatsby-transformer-cloudinary.

amcc avatar amcc commented on May 29, 2024

This took a few months to happen - sorry people, hope this helps: #140

from gatsby-transformer-cloudinary.

raae avatar raae commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.