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.

[Metro Bundler] Maximum call stack size exceeded (when upgrading to 0.50.1)

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
  OS: Linux 4.10
  Node: 8.9.0
  Yarn: 1.3.2
  npm: 5.5.1
  Watchman: 4.1.0
  Xcode: N/A
  Android Studio: Not Found

Packages: (wanted => installed)
  react: ^16.0.0 => 16.0.0
  react-native: ^0.50.1 => 0.50.1


Target Platform: iOS (10.3) & Android (targetSdkVersion 22)

Steps to Reproduce

Just upgraded from 0.49.5 to 0.50.1 and tried to bundle. The breaking changes in the new release hadn’t affected my app and shouldn’t have affected the build process.

  1. npm i react-native@0.50.1
  2. react-native bundle --verbose --platform android --dev false --entry-file index.js --bundle-output output.bundle

Output:

Scanning folders for symlinks in /home/james/Documents/react-native-app/node_modules (5ms)
Scanning folders for symlinks in /home/james/Documents/react-native-app/node_modules (7ms)
Loading dependency graph, done.

Maximum call stack size exceeded
[Error]  "react-native bundle" command exited with code 1.

On the other hand when I reinstalled react-native 0.49.5:

  1. npm install react-native@0.49.5
  2. react-native bundle --verbose --platform android --dev false --entry-file index.js --bundle-output output.bundle

Output:

Scanning folders for symlinks in /home/james/Documents/react-native-app/node_modules (5ms)
Scanning folders for symlinks in /home/james/Documents/react-native-app/node_modules (13ms)
Loading dependency graph, done.
bundle: start
bundle: finish
bundle: Writing bundle output to: output.bundle
bundle: Done writing bundle output
Assets destination folder is not set, skipping...

What does work

Running react-native start (i.e. developer mode) works fine

Expected Behavior

The project should bundle correctly

Actual Behavior

The bundling fails with a stack overflow. There’s no clear indication what is causing the behavior because there’s no stack trace despite explicitly enabling verbose mode. I don’t know whether stack traces of these errors are kept but it may be helpful in identifying the problem.

I upgraded Node (from v6 to v8) because I thought that may be causing it.

Installed packages

β”œβ”€β”€ axios@0.17.0
β”œβ”€β”€ babel-cli@6.26.0
β”œβ”€β”€ UNMET PEER DEPENDENCY babel-eslint@8.0.1
β”œβ”€β”€ babel-preset-es2015@6.24.1
β”œβ”€β”€ babel-preset-flow@6.23.0
β”œβ”€β”€ babel-preset-react-native@4.0.0
β”œβ”€β”€ eslint@4.10.0
β”œβ”€β”€ eslint-config-airbnb@16.1.0
β”œβ”€β”€ eslint-config-react-app@2.0.1
β”œβ”€β”€ eslint-plugin-flowtype@2.39.1
β”œβ”€β”€ eslint-plugin-import@2.8.0
β”œβ”€β”€ UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y@6.0.2
β”œβ”€β”€ eslint-plugin-react@7.4.0
β”œβ”€β”€ eslint-plugin-react-native@3.1.0
β”œβ”€β”€ flow-bin@0.58.0
β”œβ”€β”€ immutable@4.0.0-rc.7
β”œβ”€β”€ jest@21.2.1
β”œβ”€β”€ prettier-eslint@8.2.1
β”œβ”€β”€ prop-types@15.6.0
β”œβ”€β”€ react@16.0.0
β”œβ”€β”€ react-dom@16.0.0
β”œβ”€β”€ react-native@0.50.1
β”œβ”€β”€ react-native-code-push@5.1.3-beta
β”œβ”€β”€ react-native-htmlview@0.12.1
β”œβ”€β”€ react-native-keyboard-aware-scrollview@1.1.7 (git+https://github.com/jamsch/react-native-keyboard-aware-scrollview.git#5575b8c31df341c1719630fe2c7c08c171477243)
β”œβ”€β”€ react-native-music-control@0.4.12
β”œβ”€β”€ react-native-offline@3.4.0
β”œβ”€β”€ react-native-popup-menu@0.9.0
β”œβ”€β”€ react-native-sentry@0.30.2
β”œβ”€β”€ react-native-sound@0.10.4
β”œβ”€β”€ react-native-swiper@1.5.13
β”œβ”€β”€ react-native-vector-icons@4.4.2
β”œβ”€β”€ react-native-version-up@1.0.7
β”œβ”€β”€ react-native-video@2.0.0
β”œβ”€β”€ react-native-video-player@0.8.5
β”œβ”€β”€ react-native-voice@0.2.5
β”œβ”€β”€ react-navigation@1.0.0-beta.19
β”œβ”€β”€ react-redux@5.0.6
β”œβ”€β”€ react-test-renderer@16.0.0
β”œβ”€β”€ redux@3.7.2
β”œβ”€β”€ redux-devtools-extension@2.13.2
β”œβ”€β”€ redux-persist@5.2.2
β”œβ”€β”€ redux-saga@0.16.0
β”œβ”€β”€ reselect@3.0.1
β”œβ”€β”€ rimraf@2.6.2
β”œβ”€β”€ shortid@2.2.8

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:43 (24 by maintainers)

github_iconTop GitHub Comments

5reactions
fungilationcommented, Nov 8, 2017

but we are upgrading from RN 0.36

You are a brave man.

I confirm RN 0.50.3 fixed my issue, without need for bumping metro-bundler version in package.json resolutions.

3reactions
grabboucommented, Nov 8, 2017

0.50.3 is on CI now and should be on npm soon.

On Wed, 8 Nov 2017 at 10:47 Andreas Amsenius notifications@github.com wrote:

I confirm that with resolutions using metro bundler 0.20.1 in our project solves:

Our app seems to be working fine but we are upgrading from RN 0.36 so we have a lot of QA to do.

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/16689#issuecomment-342764639, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWcxid-5Qo2AB6oMwclfmv6agLys98Aks5s0Xi4gaJpZM4QSowl .

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Metro Bundler] Maximum call stack size exceeded (when ...
[Metro Bundler] Maximum call stack size exceeded (when upgrading to 0.50.1)
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
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 >
Npm err maximum call stack size exceeded react native
[Metro Bundler] Maximum call stack size exceeded (when upgrading to 0.50.1) #16689 ... Scanning folders for symlinks in /home/james/Documents/react-native-app/Β ...
Read more >
Error RangeError: Maximum call stack size exceeded
We have validated the reported β€œThis error is almost always means you have a problem with recursion in JavaScript code” problem at our...
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