Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Issue running for 'Release' after upgrading to RN v0.50 #588

Open
jonching opened this issue Nov 5, 2017 · 10 comments
Open

Issue running for 'Release' after upgrading to RN v0.50 #588

jonching opened this issue Nov 5, 2017 · 10 comments

Comments

@jonching
Copy link

jonching commented Nov 5, 2017

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 6.9.1
Yarn: Not Found
npm: 3.10.8
Watchman: 4.7.0
Xcode: Xcode 9.1 Build version 9B55
Android Studio: Not Found

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

Steps to Reproduce

  1. Open xcode
  2. Product -> Edit scheme -> Build configuration "Release"
  3. Build and run for device or simulator

Expected Behavior

App successfully runs.

Actual Behavior

Stalls at launch screen and produces the following Xcode error:

E1104 15:25:43.994065 1870475264 JSCHelpers.cpp:137] Got JS Exception: Can't find variable: self (/var/containers/Bundle/Application/30C12CDD-E4C1-46CB-8972-FB0FF5650DDF/hydrangea.app/main.jsbundle:389)
E1104 15:25:43.994191 1870475264 JSCHelpers.cpp:143] Got JS Stack: /var/containers/Bundle/Application/30C12CDD-E4C1-46CB-8972-FB0FF5650DDF/hydrangea.app/main.jsbundle:389:12193

Reverting my react native version back to 0.49.3 makes it work again. I tried removing ios/build directory, doing xcode cleans, npm installing and always end up with this same error when building for release.

I ran a script to show what the error exactly was inside main.bundlejs. It's attached in the following image.

screen shot 2017-11-05 at 12 44 58 am

@huhuanming
Copy link

image

@huhuanming
Copy link

huhuanming commented Nov 6, 2017

{try{return global || window}catch(a){return self }}

it can work well!

@huhuanming
Copy link

huhuanming commented Nov 6, 2017

"react-native-fetch-blob": "huhuanming/react-native-fetch-blob",

you can solved this problem temporarily by this way.

@jonching

@bnjm
Copy link

bnjm commented Nov 6, 2017

@huhuanming I tried your fork but now instead of self the error that gets thrown is can't find variable: window

@huhuanming
Copy link

you should both fix oboe-browser.js and oboe-browser.min.js

@aforty
Copy link

aforty commented Nov 8, 2017

Thanks @huhuanming.

I feel lucky to just have found my way here, most people probably won't even be able to debug this error to this point.

Can we push the fix asap?

@huhuanming
Copy link

@aforty
Copy link

aforty commented Nov 8, 2017

Seems that react-native 0.50.3 fixes the bundler issue.

@asgvard
Copy link

asgvard commented Nov 15, 2017

Can confirm it's fixed in 0.50.3

@huhuanming
Copy link

Sure.

I check it on Release.

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

No branches or pull requests

5 participants