Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebpackError: TypeError: Cannot read property 'add' of undefined #37

Open
magicspon opened this issue Dec 8, 2019 · 6 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@magicspon
Copy link

magicspon commented Dec 8, 2019

Heyo..

I'm getting an error when running develop or build.

config:

const { plugins } = require('./postcss.config')

module.exports = {
	siteMetadata: {
		title: 'waffles'
	},
	plugins: [
		'gatsby-plugin-react-helmet-async',
		{
			resolve: `gatsby-plugin-nprogress`,
			options: {
				color: `#345DEE`,
				showSpinner: false
			}
		},
		{
			resolve: 'gatsby-plugin-postcss',
			options: {
				postCssPlugins: plugins
			}
		}
	]
}

browser:

export const wrapRootElement = ({ element, props }) => {
	const store = init({
		models,
		plugins: [persistPlugin]
	})
	const persistor = getPersistor()

	return (
		<Provider store={store}>
			<PersistGate loading="loading" persistor={persistor}>
				<NavProvider>
					<ThemeProvider>
						<Layout {...props}>{element}</Layout>
					</ThemeProvider>
				</NavProvider>
			</PersistGate>
		</Provider>
	)
}

ssr

exports.wrapRootElement = ({ element, props }) => {
	const store = init({
		models
	})
	return (
		<Provider store={store}>
			<NavProvider>
				<ThemeProvider>
					<Layout {...props}>{element}</Layout>
				</ThemeProvider>
			</NavProvider>
		</Provider>
	)
}

gatsby info:

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 13.1.0 - ~/.nvm/versions/node/v13.1.0/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.13.1 - ~/.nvm/versions/node/v13.1.0/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 78.0.3904.108
    Firefox: 70.0.1
    Safari: 13.0.3
  npmPackages:
    gatsby: ^2.18.7 => 2.18.7
    gatsby-plugin-manifest: ^2.2.31 => 2.2.31
    gatsby-plugin-module-local-ident-name: ^0.0.7 => 0.0.7
    gatsby-plugin-nprogress: ^2.1.7 => 2.1.15
    gatsby-plugin-offline: ^3.0.27 => 3.0.27
    gatsby-plugin-postcss: ^2.1.8 => 2.1.16
    gatsby-plugin-react-helmet-async: ^1.0.13 => 1.0.13

image

Any thoughts?

cheers

@MartinRosenberg MartinRosenberg added the bug Something isn't working label Dec 13, 2019
@MartinRosenberg MartinRosenberg added the help wanted Extra attention is needed label Dec 20, 2019
@MartinRosenberg
Copy link
Collaborator

Hi @magicspon! Thanks for the bug report. Unfortunately I have had zero time to look at this lately, having just started a new job, and I'm not sure when things will calm down. I've added a "help wanted" label for now.

@paultannenbaum
Copy link

@magicspon Did you ever resolve this issue? I am running into the same issue on a project I am working on, wondering if you found a fix

@pweikel
Copy link

pweikel commented Feb 9, 2021

I'm having the same issue and also looking for a fix

@magicspon
Copy link
Author

@paultannenbaum sorry, I can't remember...
I used gatsby-plugin-react-helmet on my last gatsby site without any issues.

@paultannenbaum
Copy link

@pweikel In our project, I first tried removing this repo's plugin and implementing react-helmet-async manually, but when I did this I was only getting helmet to set items in our <head /> during rehydration. I did not spend a ton of time on trying to get SSR to work, but it was a deal breaker for our SEO and so I just reverted back to using react-helmet for our project. I plan on reattempting to implement react-helmet-async when I have more time. Please let us know if you find a solution that you can share.

@MartinRosenberg
Copy link
Collaborator

Oh my god, I forgot about this issue, I'm sorry everyone. Could someone link me a repo with this problem? I have a much easier time debugging that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants