-
Notifications
You must be signed in to change notification settings - Fork 660
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
Uncaught RangeError: Maximum call stack size exceeded #373
Comments
Same here. Is there a solution to this? |
Yeh same. The work around for us was to not use react children to pass in
|
Just ran into this issue as well. Only saw it happening for Safari and Chrome browsers. |
What is the reasoning behind the deep equality check? Per the React docs...
|
I believe you can also work around this by applying a unique |
@jaredLunde not sure how that could speed up Line 93 in c102586
|
@dmitriykharchenko Sorry, that was a reference to the |
@jaredLunde this error happens because ReactHelmet compares props with deepEqual and when there are children in props it iterate over children as well and since those children are React components (not a plain objects) it simply overflows the stack. The workaround is to avoid providing any children to |
So, I don't see any reason why |
@dmitriykharchenko Gotcha! Well in that case, |
Hm, interesting. Do you have a link to read more about re-mounts of keyed elements? |
https://reactjs.org/docs/reconciliation.html#keys Essentially, when the key changes it tells the reconciliation algorithm that the element in the new tree is different from the element in the old tree. If the new key wasn't in the children in old tree, a new component is mounted. If the new key was in the children in the old tree the element will be re-used. |
Aha, you mean that you have to update that key on every render. |
Well, you only have to update the key when the underlying children change. In my case that happens when that particular view URL changes, but you can use any string representation. Maybe someone has a react-router match.params change which updates the title or meta information - that'd be a good spot to use |
It might not work in some cases. Either way I think we're all in agreement that deepEqual is a bad practice in sCU. |
This is a really bad bug - as the props way is not even the documented recommended way to pass metadata to helmet, and there is no other workaround. |
Just replace it by https://github.com/FormidableLabs/react-fast-compare |
Why this is still not adressed? |
This bug is devastating. Had to switch to react-helmet-async which doesn't have this problem 😢 |
#402 was merged into master. I would like to get the roll-up PR merged and we can release a beta version for feedback. |
I have the same problem............... |
I believe it's merged to |
FWIW I had this issue when running nightwatch / magellan tests. The offending code was in an HOC. The fix was to use an existing instance of helmet as follows: + const helmet = <Helmet><style key={styles.__hash}>{styles.__css}</style></Helmet>;
+
const EnhancedComponent = props => (<Fragment>
- <Helmet>
- <style key={styles.__hash}>{styles.__css}</style>
- </Helmet>
+ { helmet } (I would suspect that Fingers crossed this will improve performance as well. |
@rockmandash Agree: this should be reopened due to not being fixed so far because otherwise it confuses people searching for this type of issue. |
Merged in master, but not yet release. Reopening and will close once it gets published to NPM. |
Well, I fixed that by removing helmet and implementing my own little lib. |
Looking forward to a release 😍 We have this problem as well and just tracked down the issue. |
@donaldpipowitch |
We are volunteers and I was on paternity leave (returned last tuesday). Please be civil, we are all human. You are also welcome to pull from master, copy and paste the code into a vendor folder and use as is. Or use a different package entirely, react-helmet-async looks promising https://github.com/staylor/react-helmet-async. |
Updating for visibility. We had some organizational changes and I need to get permission in order to publish to NPM. While that is in progress, we have published to our internal nexus servers for testing. Stay tuned. v.6.0.0-beta is coming. thank you all. |
I can understand why this guy is frustrated, given that there is no new release for this package more than a year, but I don't agree on how he diss the maintainers or contributers. I think you guys should have released a patched version for v5 without the rollup. |
I few months ago (when I failed to use this library) - I wrote another one. It's not a drop in replace due to different design (does not create title/meta tags), but could save your day - https://github.com/theKashey/react-push-channel |
@kambing86 is right a patch version will be great at least we can publish the changes to our production application without any nasty hacks to fix this issue. |
My application crashes frequently due to this bug. If this bug isn't resolved before our product launch, I'm forced to replace it with another lib / my own implementation 😕 I guess it's not too hard to release a v5 patch? Has nothing to do with the current work on v6 right? |
Avoids the error at nfl/react-helmet#373 where the maximum call stack size is exceeded because of a deepEqual on React children.
I came across this issue as well. Looking forward to the next release with the fix. |
For some strange reason it happens just for one person in our office, so we haven't noticed this bug during development and tests. Any chance of releasing the beta version soon? :) |
I got a temporary workaround for this issue.
Make sure the import path is correct. Once the fix is published to NPM you can delete the |
Hello guys. |
Remember how it all started in 2015?
Three years passed and no one cares anymore. Frontend was blooming at the time. |
Please everyone, give @tmbtech a rest or pay him money for working on this issue. Everyone can fork this lib and patch the code or switch to react-helmet-async or use an object for configuration. There are a lot of alternatives. |
Wow, people are rude. |
Ok, I can to pay something. What the cost you’re talking about? |
Dont forget - you may fork this repo and publish as |
Hi all, Quick update. @cwelch5 and I got the required permission to NPM. We will be publishing to NPM today or tomorrow. because the thread is getting a little out of hand, I'm closing and locking the thread. I will be adding a code of conduct and other community support documentation. #424 Thank you all, and thank you for being apart of the community. |
Thanks everyone, publishing is working now again. We should be able to post new NPM builds with ease. |
Hey,
HelmetWrapper
usesdeepEqual
to compare props and of course, there are react children components with endless amount of nested objects.This seems like a dangerous way to check props equality. Could we turn
HelmetWrapper
intoPureComponent
?The text was updated successfully, but these errors were encountered: