question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError - Maximum call stack size exceeded.

See original GitHub issue

Hi there,

I liked the API design of this library and decided to use it together with react-native-modalize. It worked well locally, but in distribution builds the below error caused crashes on both iOS and Android.

I switched to another library and unfortunately can’t put time into creating a bare minimum reproducible case. But I thought I’d share it!

RangeError
Maximum call stack size exceeded.

    node_modules/immer/dist/immer.esm.js:1:712 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588 
    node_modules/immer/dist/immer.esm.js:1:782 
    [native code] forEach
    node_modules/immer/dist/immer.esm.js:1:745 i
    node_modules/immer/dist/immer.esm.js:1:2562 M
    node_modules/immer/dist/immer.esm.js:1:3055 A
    node_modules/immer/dist/immer.esm.js:1:2588

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:36 (16 by maintainers)

github_iconTop GitHub Comments

4reactions
UrbanChrisycommented, Aug 18, 2021

I was using react context provider inside the Portal component, and I was getting this issue in a release build only like above. When I moved the context provider to the outside of the PortalHost. Because I’m using the portal host at a different layer than the root host. Then I no longer had this issue. I don’t know what would cause this, but ill try to create a reproducible expo demo tomorrow. Ill update where I get to.

2reactions
gorhomcommented, Sep 21, 2021

this should be fixed with v1.0.9 , thanks to @egadstar PR 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >
RangeError: Maximum call stack size exceeded in JavaScript
The "RangeError: Maximum call stack size exceeded" error occurs when a function is called so many times that the invocations exceed the call...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found