tgallacher / gatsby-plugin-remove-generator

🕵️‍♀️ Customise or remove the "meta generator" tag on your Gatsby site.
https://npm.im/gatsby-plugin-remove-generator
MIT License
7 stars 2 forks source link

Error when using DEV_SSR = true #173

Open danilobuerger opened 2 years ago

danilobuerger commented 2 years ago

When enabling DEV_SSR, I am getting the following error:

Failed to Server Render (SSR)
Error message:
TypeError: Cannot read properties of undefined (reading 'type') (from plugin: gatsby-plugin-remove-generator)

File:
node_modules/gatsby-plugin-remove-generator/gatsby-ssr.js:17:24

Stack:
WebpackError: TypeError: Cannot read properties of undefined (reading 'type') (from plugin: gatsby-plugin-remove-generator)
    at node_modules/gatsby-plugin-remove-generator/gatsby-ssr.js:17:24
    at node_modules/gatsby-plugin-remove-generator/gatsby-ssr.js:16:6
    at .cache/api-runner-ssr.js:68:22
    at .cache/api-runner-ssr.js:61:11
    at .cache/ssr-develop-static-entry.js:321:16
    at node_modules/@gatsbyjs/reach-router/es/lib/history.js:63:1
    at .cache/ssr-develop-static-entry.js:334:19

It seems like some of the head components can be undefined and so the error occurs.

tgallacher commented 1 year ago

Hey @danilobuerger can you confirm which version of Gatsby and the plugin you have and I can take a look. Thanks!

danilobuerger commented 1 year ago

@tgallacher gatsby: 4.23.0 gatsby-plugin-remove-generator: 1.2.0 Thanks for taking a look.

tj-noor commented 1 year ago

Ran into the same issue as well with FAST_DEV, which enables DEV_SSR as well.

gatsby: 4.25.2 gatsby-plugin-remove-generator: 1.2.0

WebpackError: TypeError: Cannot read properties of undefined (reading 'type') (from plugin: gatsby-plugin-remove-generator)
    at autocompanion/node_modules/@mui/material/CardActionArea/CardActionArea.js:102:28
    at autocompanion/node_modules/@mui/material/CardActionArea/CardActionArea.js:102:12
    at autocompanion/node_modules/@mui/base/utils/omitEventHandlers.js:13:1
    at autocompanion/node_modules/@mui/material/TableRow/TableRow.js:76:1
    at autocompanion/node_modules/@emotion/cache/dist/emotion-cache.esm.js:58:1
    at autocompanion/node_modules/@mui/material/TableRow/TableRow.js:88:38

Appreciate your work on this plugin!

tgallacher commented 1 year ago

I can't seem to reproduce this, with either flag.

If someone can provide steps to reproduce, or create a basic skeleton repo that demonstrates the issue, then I can investigate further 🙏