Skip to content

Error [ValidationError]: "error" must be of type object #214

@nmampersand

Description

@nmampersand

Hello! I am working on a project using Gatsby, Cloudinary, and Sanity and am running into the error with this plugin:

Failed to validate error [Error [ValidationError]: "error" must be of type object] {
  _original: {
    context: {
      sourceMessage: '[gatsby-transformer-cloudinary] Could not get metadata for undefined > undefined: undefined'
    },
    error: 'Unknown cloud_name',
    pluginName: 'gatsby-transformer-cloudinary',
    text: '[gatsby-transformer-cloudinary] Could not get metadata for undefined > undefined: undefined',
    level: 'ERROR',
    stack: [],
    docsUrl: 'https://gatsby.dev/issue-how-to'
  },
  details: [
    {
      message: '"error" must be of type object',
      path: [Array],
      type: 'object.base',
      context: [Object]
    }
  ]
}

I am only using images already in Cloudinary but have tried configuring it with and without my Cloudinary credentials and receive the same error.

My gatsby-config looks like:

plugins: [
...,
{
    resolve: 'gatsby-source-filesystem',
    options: {
      name: `images`,
      path: `${__dirname}/src/images/`
    },
  }, {
    resolve: `gatsby-source-cloudinary`,
    options: {
      cloudName: process.env.CLOUDINARY_CLOUD_NAME,
      apiKey: process.env.CLOUDINARY_API_KEY,
      apiSecret: process.env.CLOUDINARY_API_SECRET,
    },
  }, {
    resolve: 'gatsby-transformer-cloudinary',
    options: {
      cloudName: process.env.CLOUDINARY_CLOUD_NAME,
      apiKey: process.env.CLOUDINARY_API_KEY,
      apiSecret: process.env.CLOUDINARY_API_SECRET,
      transformTypes: [
        `CloudinaryMedia`,
        `CloudinaryAsset`,
        `SanityCloudinaryAsset`
      ],
    },
  }]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions