Skip to content
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

React Native 0.50.1 - Release Crash #1348

Closed
stephenheron opened this issue Nov 7, 2017 · 18 comments
Closed

React Native 0.50.1 - Release Crash #1348

stephenheron opened this issue Nov 7, 2017 · 18 comments

Comments

@stephenheron
Copy link

Hi,

I just upgraded from RN 0.49 to 0.50.1 and have ran into problem when building and running the release version. I trimmed my app back to the simplest version it could be and I narrowed it down to NativeBase.

react-native, react and native-base version

"native-base": "^2.3.3",
"react": "^16.0.0",
"react-native": "^0.50.1",

Expected behaviour

App does not crash when built for release and ran.

Actual behaviour

App crashes when built and ran in release mode. The following output is shown in the Xcode output:

Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: undefined is not an object (evaluating 'e.length')', reason: 'Unhandled JS Exception: undefined is not an object (evaluating 'e.length'), stack:
<unknown>@340:132
<unknown>@340:196
exports@340:395
<unknown>@338:218
<unknown>@338:72
t@2:620
<unknown>@333:1740
t@2:620
<unknown>@332:131
t@2:620
<unknown>@331:131
t@2:620
<unknown>@330:308
t@2:620
<unknown>@329:216
t@2:620
<unknown>@308:742
t@2:620
<unknown>@13:152
t@2:620
<unknown>@12:30
t@2:620
<unknown>@2:154
global code@631:9
'
*** First throw call stack:
(0x182a27d38 0x181f3c528 0x182a27c80 0x100fd5398 0x100fd305c 0x182a2f6a0 0x18290e820 0x18291322c 0x100fe6058 0x101025d74 0x101025ad4 0x103ffd49c 0x103ffd45c 0x10400c110 0x1040009a4 0x10400d104 0x104014100 0x182652fe0 0x182652c30)

Steps to reproduce (code snippet or screenshot)

This code causes the issue to appear:

import React from 'react';

import {
  AppRegistry,
  //Text
} from 'react-native';
import {
  Text
} from 'native-base';

export default class App extends React.Component {
  render() {
    return (
      <Text>Hello World</Text>
    );
  }
}

AppRegistry.registerComponent('whereverly_app', () => App);

However if I remove the reference to NativeBase it all seems to work. Working code:

import React from 'react';

import {
  AppRegistry,
  Text
} from 'react-native';

export default class App extends React.Component {
  render() {
    return (
      <Text>Hello World</Text>
    );
  }
}

AppRegistry.registerComponent('whereverly_app', () => App);

Screenshot of emulator/device

N/A

Is the bug present in both ios and android or in any one of them?

I am only developing on iOS currently.

Any other additional info which would help us debug the issue quicker.

Sorry I can't be of more help but the issue only appears in production which makes it tricky to track down. I thought it might be something todo with this: facebook/react-native#16567

@PvanHengel
Copy link

We are having the same issue spent at least half the day debugging, which wasn’t really debugging since the error description was so terrible. We need a fix ASAP for this.

@whevether
Copy link

0.50 has many changes, including index.android.js and index.ios.js merge. If you upgrade, you need to do a lot of work

@SupriyaKalghatgi
Copy link
Contributor

@brunolemos
Copy link

I have the same crash on release but I dont use NativeBase.
Created this issue on official repository: facebook/react-native#16745

@nim23
Copy link

nim23 commented Nov 8, 2017

I had the same issue but the issue has been resolved for me by adding below to package.json and doing yarn install.

"resolutions": {
        "metro-bundler": "0.20.1"
}

The issue is with metro-bundler and the uglify process. I tried unmangling the minified bundle and the issue was coming from color-convert dependency that NativeBase pulls in as part of the color dependency. But the fix should be in metro-bundler itself and eventually react-native.

@PvanHengel
Copy link

Unfortunately 20.1 didn't work for us... We are still digging, hope someone finds a fix soon!

@Freddy03h
Copy link

And neither 0.20.2

@PvanHengel
Copy link

Im trying 20.2 now as well... I assume will get the same result as you, fingers crossed though, this is a major blocker.

@PvanHengel
Copy link

Agreed 0.20.2 doesn't work either...

@jacargentina
Copy link

Same here, doing this to be sure:

  • react-native updated from 0.50.0 (working build published on App Store) to 0.50.3
  • rm -rf node_modules/
  • npm i
  • react-native run-ios --configuration=release
  • app crashes after splash screen is shown

@naviocean
Copy link

I got the same issue, but it works fine in debug mode

@naviocean
Copy link

naviocean commented Nov 10, 2017

I found the solution, just add this code into package.json

"resolutions": {
		"metro-bundler": "0.20.2",
		"color-convert": "1.9.1",
		"uglify-js": "github:alexlamsl/UglifyJS2#issue-2449"
},

@jacargentina
Copy link

Yes! Thanks @naviocean

@croustibat
Copy link

croustibat commented Nov 18, 2017

Uglify-js tag a version 3.1.9 that fix the issue, i can build a with the release flag now, so you can add resolutions like this :

"metro-bundler": "0.20.2",
"color-convert": "1.9.1",
"uglify-js": "3.1.9"

@munkhorgil
Copy link

munkhorgil commented Dec 6, 2017

I got this error, tried adding uglify js not working any other solution?
It works fine in debug mode.

  • React-Native 0.50.4
  • React 16.0.0

SupriyaKalghatgi added a commit that referenced this issue Dec 7, 2017
PropTypes issue - fix for #1348
React Native 0.50.1 - Release Crash
@SupriyaKalghatgi
Copy link
Contributor

Fixed with NativeBase 2.3.5

@mosleim
Copy link

mosleim commented Oct 2, 2018

this happens again!
my package is:

  "dependencies": {
    "@babel/runtime": "^7.1.2",
    "native-base": "^2.8.0",
    "react": "16.5.0",
    "react-native": "0.57.1",
    "react-native-charts-wrapper": "^0.4.8",
    "react-navigation": "^2.17.0"
  },

@matthewfbenjamin
Copy link

I'm still getting an error too. I am not 100% certain that nativeBase is the issue but here is the error I'm getting from Android Studio and what versions I am using.

"native-base": "2.8.1",
"native-base-shoutem-theme": "0.2.2",
"prop-types": "^15.6.2",
"react": "16.4.1",
"react-native": "0.56.1",
2018-12-05 12:46:58.940 23769-23822/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.unrollme, PID: 23769
    com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'Sn[e]'), stack:
    extractEvents@118:27186
    extractEvents@118:23685
    handleTopLevel@118:27393
    <unknown>@118:28878
    qn@118:28103
    z@118:6018
    perform@119:3484
    batchedUpdates@119:18574
    Ce@118:10516
    Q@118:6049
    K@118:6111
    _receiveRootNodeIDEvent@118:28849
    receiveEvent@118:28961
    value@32:2975
    <unknown>@32:280
    value@32:2426
    callFunctionReturnFlushedQueue@32:252
    
        at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
        at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:193)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests