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.

App force close on release mode: undefined is not an object (evaluating 'e.length')

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS High Sierra 10.13 Node: 8.9.0 Yarn: 1.2.1 npm: 5.5.1 Watchman: 4.7.0 Xcode: Xcode 9.1 Build version 9B37 Android Studio: 3.0 AI-171.4402976

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

Target Platform: iOS (11.1)

Steps to Reproduce

  1. App with React Native v0.50+ installed
  2. Run debug build (works)
  3. Run release build (crash on app open)

Expected Behavior

Not crash

Actual Behavior

Crash on app open with this error: RCTFatalException: Unhandled JS Exception: undefined is not an object (evaluating 'e.length')'

Stack points inside the color-converter package.

Current workaround

  • Downgrade to 0.49.5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:38
  • Comments:47 (7 by maintainers)

github_iconTop GitHub Comments

16reactions
mobdimcommented, Nov 10, 2017

My solution:

"react-native": "0.50.3",
"react": "^16.0.0",

remove resolutions from package.json

and build steps:

watchman watch-del-all
rm -rf $TMPDIR/react-*
rm yarn.lock
rm android/app/src/main/assets/index.android.bundle
rm android/app/src/main/assets/index.android.bundle.meta
yarn cache clean
yarn install
mkdir -p android/app/src/main/assets/
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
cd android
./gradlew clean
./gradlew assembleDebug
cd ..

Everything ok!

8reactions
andrew-wagner89commented, Nov 8, 2017

I was able to fix the problem by resolving the color-convert package to use the pull request here: Qix-/color-convert/pull/49

just changed my package.json to include: "resolutions": { "color-convert": "github:zbarbuto/color-convert" }

this is just a workaround though since other packages might declare the same var twice which breaks uglify

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined is not an object (evaluating 'e.length')
App force close on release mode : undefined is not an object (evaluating 'e.length')
Read more >
iOS App Crashes in release mode "undefined is not an ...
Found the issue. One of the third-party components was causing it because I as passing null to somehow.
Read more >
Getting "TypeError: undefined is not an object (evaluating ' ...
After upgrading to Expo 41 I'm getting the following error as soon as my app loads: TypeError: undefined is not an object (evaluating ......
Read more >
error: undefined is not an object (evaluating '$scope. ...
You have declared $scope.inputcode but not as an object - as it currently exists, it is just undefined . You need to initialise...
Read more >
App crashes with "undefined is not an object (evaluating 'e. ...
App crashes with "undefined is not an object (evaluating 'e.issue.id')" error : YTM-484.
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