-
Notifications
You must be signed in to change notification settings - Fork 151
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
this.props.context.helmetInstances is undefined
(in Gatsby project)
#145
Comments
Solve the problem by adding HelmetProvider I've had the same problem
I locked version 1.0.9 It was OK until I reinstalled node_modules |
I'm seeing the same problem, after updating to webpack v5. |
I suspect it comes from this line: https://github.com/staylor/react-helmet-async/blob/main/src/Dispatcher.js#L60 Would be good to understand, how this might end up as |
I believe that, for me, this was caused by a broken bundle that resulted in multiple instances of React being used. |
I am facing the same issue (with a custom SSR application w/ React v17.0.2) - Wrapping both the client & server in a |
I have the same issue now with vitejs 5 + rollup 4. The app breaks in production build (npm run dev is fine). The error is: TypeError: Cannot read properties of undefined (reading 'add') It comes from this line react-helmet-async/src/Dispatcher.tsx Line 71 in 6a37f73
|
I'm trying to replace
react-helmet
withreact-helmet-async
but have run into an issue. When I place the provider in one of Gatsby's functions that wraps all pages (tried bothwrapPageElement
as well aswrapRootElement
and got same results), I get the following error:In Chrome:
In Firefox:
My SEO component which renders the
Head
component and meta tags is in a shared directory which is imported and used in two different projects. I'm not sure if this is related.If I put the provider in the SEO component (directly around the
Helmet
tag) then it seems to work and doesn't throw an error, however, I don't think this is the right approach as then the provider wouldn't be shared if I wanted to useHelmet
again outside of the SEO component (e.g. to add one-off head elements in one page somewhere)The text was updated successfully, but these errors were encountered: