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

Workaround for _globalWindow2['default'] / __reactComponentProxies error #16858

Closed
jamesreggio opened this issue Nov 16, 2017 · 2 comments
Closed
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@jamesreggio
Copy link
Contributor

There's a bug in the TypeScript runtime support library (tslib) that will cause one of the following cryptic errors in a React Native app:

undefined is not an object (evaluating '_globalWindow2['default'].__reactComponentProxies')

Cannot read property '__reactComponentProxies' of undefined

tslib is utilized by a variety of different popular React Native libraries; for example: lodash-decorators.

The tslib maintainers have fixed the issue (in microsoft/tslib#42) but they haven't published a release yet.

The easiest way to work around this issue at present is the following:

  1. Identify the packages which depend upon tslib by searching your yarn.lock file for tslib under the dependencies section of a dependency.

    For example, here's how that looks for lodash-decorators:

lodash-decorators@^4.5.0:
  version "4.5.0"
  resolved "https://registry.yarnpkg.com/lodash-decorators/-/lodash-decorators-4.5.0.tgz#a4bb63dfbb512f0dd9409f7af452e4e2edcb80f4"
  dependencies:
    tslib "^1.7.1"
  1. Ensure you're using yarn version 1.0 or higher. (Just run yarn and you'll see your current version.) brew update && brew upgrade yarn if you're out of date.

  2. Add a resolutions section to your package.json file for every tslib dependency you found earlier. The resolution key should be the package with a dependency, followed by /tslib, and the value is a specific commit on the tslib repo that contains the fix.

    For the lodash-decorators package, it looks like this:

"resolutions": {
  "lodash-decorators/tslib": "Microsoft/tslib#375b3f6"
},

I realize this is not an issue on React Native, so you're welcome to close it. I just wanted to share a workaround in a place where I expect most people will begin searching for this problem after a React Native upgrade.

@react-native-bot
Copy link
Collaborator

@facebook-github-bot no-template

@facebook-github-bot
Copy link
Contributor

Hey @jamesreggio, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!

How to ContributeWhat to Expect from Maintainers

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Nov 16, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Nov 16, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants