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

Fix Crash In React Native 0.50 & 0.51 #589

Closed
wants to merge 2 commits into from

Conversation

huhuanming
Copy link

solved cannot find self temporarily by this way and will open a PR in oboe lately.

@huhuanming huhuanming changed the base branch from 0.10.9 to 0.10.8 November 6, 2017 03:37
@Freddy03h
Copy link

Freddy03h commented Nov 6, 2017

This change doesn't fix the issue in my project (RN 0.50.1, after deleted node_modules, re-yarn and XCode > Product > Clean)

It seems that global and window are the same object on Debug Mode, and we still go to the catch on Release Mode.

@huhuanming
Copy link
Author

But work well in my project...

it seems that your project includes other issues, not only this.

@Freddy03h
Copy link

Hum, weird…

What's you config ?

Mine:

  • macOS 10.13.1
  • XCode 9.1
  • iOS 11.1 (simulator and real device)
  • node 8.7.0
  • yarn 1.2.1

@huhuanming
Copy link
Author

Me too, my config is same as your.

@huhuanming huhuanming changed the title Fix Crash In React Natiec 0.50 & 0.51 Fix Crash In React Native 0.50 & 0.51 Nov 7, 2017
@aforty
Copy link

aforty commented Nov 8, 2017

@Freddy03h Try running watchman watch-del-all && rm -rf $TMPDIR/react-* and react-native start --reset-cache.

This branch works for me.

@Freddy03h
Copy link

@aforty I tried it, I also tried after updating node (9.1.0) and yarn (1.3.2), I also restart my computer…

But i still get the same issue on Release Mode : Got JS Exception: Can't find variable: window ( … main.jsbundle:534) on XCode, with @huhuanming fork
This issue is also described by @bnjm : #588 (comment)

No problem to build on Debug Mode, but the main.jsbundle for the Release version emits this error at runtime.

@huhuanming
Copy link
Author

huhuanming commented Nov 8, 2017

check your yarn.lock and find react-native-fetch-blob.

image

@bnjm
Copy link

bnjm commented Nov 8, 2017

@Freddy03h I realised my window issue is actually coming from another module that includes a polyfill.

Seems like there are a number of release-only bugs relating to globals, which suggests an issue with the bundler. See here:

GeekyAnts/NativeBase#1348 (comment)

@Freddy03h
Copy link

@bnjm Oh yes I just find that the JS Exception Can't find variable: window is emitted by an other module.

Thank you all !

@aforty
Copy link

aforty commented Nov 8, 2017

The bundler definitely has an issue in 0.50.x. I discovered another Android-only issue where Promise is not defined, again only in the production bundle. I downgraded to 0.49.5 for now.

@aforty
Copy link

aforty commented Nov 8, 2017

FYI, react-native 0.50.3 is out and it fixes this (and my other) bundler issue(s).

@Freddy03h
Copy link

I'm still stuck with the same issue described here : GeekyAnts/NativeBase#1348 (but I don't use NativeBase)

Anyways, It's no more related to react-native-fetch-blob.

@huhuanming
Copy link
Author

huhuanming commented Nov 13, 2017

@Freddy03h Freddy

Check your yarn.lock, maybe you can Found the parent of NativeBase.

@huhuanming
Copy link
Author

It was fix in React Native 0.50.3, I will close this PR now.

@huhuanming huhuanming closed this Nov 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants