-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
"Maximum call stack exceeded" in production while dealing with arrays #673
Comments
Did you try changing the sideEffects to see if it makes a difference? You
can use patch-package to automate that if needed. Secondly, if you force
autoFreeze in prod, does that make a difference?
…On Fri, 18 Sep 2020, 22:55 Ben Hollis, ***@***.***> wrote:
🐛 Bug Report
This appears to be similar to, if not exactly the same as #198
<#198>. I verified that
downgrading to version 6.0.9 fixes it, so it may be the same sideEffect
declaration in package.json.
I have some state that I'm operating on that's effectively an array of
objects (A), each of which has as a property another array of objects (B).
In my producer function, I'm modifying properties of those leaf (B)
objects, as well as adding them to, and removing them from, the inner
arrays (B). For example, I'm deleting an object from one B array (e.g. in
A[0]) and adding it to another B array (in A[1]).
Link to repro To Reproduce
Unfortunately, I haven't managed to reproduce this locally (in node or in
browser) or on CodeSandbox. Only our deployed production build had the
problem. I was able to verify through Sentry.io that downgrading to v6
stopped this error from happening.
Observed behavior
An infinite recursion leading to "Maximum call stack exceeded", coming
from inside the immer code.
Expected behavior
State to be updated or at least an error.
Environment
We only accept bug reports against the latest Immer version.
- *Immer version:*
- I filed this report against the *latest* version of Immer
- Occurs with setUseProxies(true)
- Occurs with setUseProxies(false) (ES5 only)
I haven't tried setUseProxies(false) - we only run in environments which
use proxies.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#673>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBDT3Y6TLET252H3A4DSGPJNFANCNFSM4RSSAAKQ>
.
|
Also, do investigate on which browsers the exception occurs. It could be
interference from some polyfill.
…On Sat, 19 Sep 2020, 08:27 Michel Weststrate, ***@***.***> wrote:
Did you try changing the sideEffects to see if it makes a difference? You
can use patch-package to automate that if needed. Secondly, if you force
autoFreeze in prod, does that make a difference?
On Fri, 18 Sep 2020, 22:55 Ben Hollis, ***@***.***> wrote:
> 🐛 Bug Report
>
> This appears to be similar to, if not exactly the same as #198
> <#198>. I verified that
> downgrading to version 6.0.9 fixes it, so it may be the same sideEffect
> declaration in package.json.
>
> I have some state that I'm operating on that's effectively an array of
> objects (A), each of which has as a property another array of objects (B).
> In my producer function, I'm modifying properties of those leaf (B)
> objects, as well as adding them to, and removing them from, the inner
> arrays (B). For example, I'm deleting an object from one B array (e.g. in
> A[0]) and adding it to another B array (in A[1]).
> Link to repro To Reproduce
>
> Unfortunately, I haven't managed to reproduce this locally (in node or in
> browser) or on CodeSandbox. Only our deployed production build had the
> problem. I was able to verify through Sentry.io that downgrading to v6
> stopped this error from happening.
> Observed behavior
>
> An infinite recursion leading to "Maximum call stack exceeded", coming
> from inside the immer code.
> Expected behavior
>
> State to be updated or at least an error.
> Environment
>
> We only accept bug reports against the latest Immer version.
>
> - *Immer version:*
> - I filed this report against the *latest* version of Immer
> - Occurs with setUseProxies(true)
> - Occurs with setUseProxies(false) (ES5 only)
>
> I haven't tried setUseProxies(false) - we only run in environments which
> use proxies.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#673>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAN4NBDT3Y6TLET252H3A4DSGPJNFANCNFSM4RSSAAKQ>
> .
>
|
Good suggestions, I'll do those experiments and get back to you. |
Hello, |
I am also having the same issue and this happens only when i have large items in the page like Grids, when i downgraded to 6.0.9 i do not see the issue. I tested it in multiple browser as well. Like Bhollis reported this looks similar to #198. Can someone please look into this issue or provide a work around? Thank you |
Any luck with this issue? The bug is still happening in my case, using v9.0.15. Only happens when the build is set to production mode |
Does the array contain something that is self referencing ie, a circular structure? |
I'm experiencing this with v10.0.1 only in production mode, dev mode is fine. |
This issue is closed, please open a new one and provide minimal
reproduction. You might be storing some alien object accidentally
…On Tue, 18 Apr 2023, 00:32 Carles Andrés, ***@***.***> wrote:
I'm experiencing this with v10.0.1 only in production mode, dev mode is
fine.
The same issue happened in v9.
My array does not contain any circular references.
—
Reply to this email directly, view it on GitHub
<#673 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBB272ZCLCXFRJRAVTDXBXAI7ANCNFSM4RSSAAKQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
@carlesandres Thank you so much. This was my exact issue. Thank you for leaving a clear explanation and solution here. 👍 |
🐛 Bug Report
This appears to be similar to, if not exactly the same as #198. I verified that downgrading to version 6.0.9 fixes it, so it may be the same
sideEffect
declaration inpackage.json
.I have some state that I'm operating on that's effectively an array of objects (A), each of which has as a property another array of objects (B). In my producer function, I'm modifying properties of those leaf (B) objects, as well as adding them to, and removing them from, the inner arrays (B). For example, I'm deleting an object from one B array (e.g. in A[0]) and adding it to another B array (in A[1]).
Link to repro
To Reproduce
Unfortunately, I haven't managed to reproduce this locally (in node or in browser) or on CodeSandbox. Only our deployed production build had the problem. I was able to verify through Sentry.io that downgrading to v6 stopped this error from happening.
Observed behavior
An infinite recursion leading to "Maximum call stack exceeded", coming from inside the immer code.
Expected behavior
State to be updated or at least an error.
Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
(ES5 only)I haven't tried
setUseProxies(false)
- we only run in environments which use proxies.The text was updated successfully, but these errors were encountered: