JavascriptException: Maximum call stack size exceeded when running apk file
See original GitHub issue- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Environment
OS: Windows 10
Node: 8.4.0
Yarn: 1.3.2
npm: 5.5.1
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3
Steps to Reproduce
- Create blank project using
react-native
init MyApp
- Add
babel-plugin-transform-class-properties
(^6.24.1
) andstage-0
Note that it works with thereact-native
and thees2015
presets
// babelrc
{
"presets": ["stage-0", "react-native", "es2015"],
"plugins": ["transform-class-properties"]
}
- Build the app using
gradlew assembleRelease
Do not cahnge any code, just build after adding the listed presets and plugins to the
.babelrc
and installing them vianpm
Note that: Everything is working while debugging
When run:
Expected Behavior
I expect everything just to work!
Actual Behavior
The app is built successfully but when we install the app on whatever device we get The app stopped working.
error. I researched it a bit and found this log in the logcat
:
FATAL EXCEPTION: mqt_native_modules
Process: com.PACKAGE, PID: 13125
com.facebook.react.common.JavascriptException: Maximum call stack size exceeded., stack:
<unknown>@11:410
<unknown>@11:410
I searched a bit and find out these things (which may be helpful while resolving the issue):
- Possible solution is to remove some of these presets from the
package.json
file, shown here: https://stackoverflow.com/questions/46170844/maximum-call-stack-size-exceeded-in-react-native, DIDN’T WORK FOR ME - The exact same issue is described here without ANY response: https://github.com/facebook/react-native/issues/16689#issuecomment-363238863
- Some similar logs are shown in this issue: https://github.com/facebook/nuclide/issues/900
- The apk works once again the
stage-0
preset and the plugin are removed, but in my case I need them.
Hopefully all listed information will be helpful.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:13 (1 by maintainers)
Top 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 >JavaScript RangeError: Maximum Call Stack Size Exceeded
The JavaScript RangeError: Maximum call stack size exceeded is an error that occurs when there are too many function calls, or if a...
Read more >“maximum call stack size exceeded in javascript while npm ...
It is likely that a function with infinite loop is being called.
Read more >JavaScript Error: Maximum Call Stack Size Exceeded
When a recursive function has all of the pieces it needs to run correctly, your code will end when it reaches the base...
Read more >InternalError: too much recursion - JavaScript - MDN Web Docs
The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" ... This recursive function runs 10 times, as per the exit...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m now seeing this issue in 0.56.0. I do have a lot of resolutions to fix the babel upgrade though…
Only happening with prod builds, --dev is fine.
this is not possible to solve in the described way I removed all the @connect decorators still I am getting erros and I can not remove stage0 presets because react-navigation starts giving errors. So this is catch 22. Can someone please look into this problem.