Workaround for _globalWindow2['default'] / __reactComponentProxies error #16858
Labels
Ran Commands
One of our bots successfully processed a command.
Resolution: Locked
This issue was locked by the bot.
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: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:
Identify the packages which depend upon
tslib
by searching youryarn.lock
file fortslib
under thedependencies
section of a dependency.For example, here's how that looks for
lodash-decorators
:Ensure you're using
yarn
version 1.0 or higher. (Just runyarn
and you'll see your current version.)brew update && brew upgrade yarn
if you're out of date.Add a
resolutions
section to yourpackage.json
file for everytslib
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 thetslib
repo that contains the fix.For the
lodash-decorators
package, it looks like this: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.
The text was updated successfully, but these errors were encountered: