Skip to content
This repository was archived by the owner on Oct 30, 2022. It is now read-only.
This repository was archived by the owner on Oct 30, 2022. It is now read-only.

Support for Gatsby 4 #293

@Mrtenz

Description

@Mrtenz

The gatsby-rehype-inline-images does not seem to support Gatsby 4 at the moment. With the following config:

    {
      resolve: 'gatsby-transformer-rehype',
      options: {
        filter: (node: Node) => node.internal.type === 'GhostPost',
        plugins: [
          'gatsby-rehype-inline-images'
        ]
      }
    }

I get this error when querying childHtmlRehype { html }:

{
  "errors": [
    {
      "message": "Cannot read property 'withWebp' of undefined",
      "locations": [
        {
          "line": 4,
          "column": 4
        }
      ],
      "path": [
        "ghostPost",
        "childHtmlRehype",
        "html"
      ],
      "extensions": {
        "stack": [
          "TypeError: Cannot read property 'withWebp' of undefined",
          "    at fluidImage (.../node_modules/gatsby-rehype-inline-images/gatsby-node.js:215:5)",
          "    at processImage (.../node_modules/gatsby-rehype-inline-images/gatsby-node.js:193:13)",
          "    at replaceNewImage (.../node_modules/gatsby-rehype-inline-images/gatsby-node.js:169:16)",
          "    at async Promise.all (index 3)",
          "    at module.exports (.../node_modules/gatsby-rehype-inline-images/gatsby-node.js:99:18)",
          "    at Function.Promise.each (.../node_modules/gatsby-transformer-rehype/extend-node-type.js:16:5)",
          "    at processHtmlAst (.../node_modules/gatsby-transformer-rehype/extend-node-type.js:142:7)"
        ]
      }
    }
  ],
  "data": {
    "ghostPost": {
      "childHtmlRehype": {
        "html": null
      }
    }
  },
  "extensions": {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions