You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug. I'm not sure if I should file this with React Native instead/in addition, but since the errors I encounter since upgrading from RN 0.48 to 0.49 are all bundling errors in cli, here it is.
With RN up to 0.48, my app's inclusion and import of react-native-webview-bridge like above works without issue. The package has no dependency itself of react.
Since upgrading to RN 0.49.3, this bundling error occurs on running react-native run-ios:
Unable to resolve module `react` from [package index]: Module does not exist in the module map
Then I added react as a dependency in package.json, like so:
"devDependencies": {
"react": "16.0.0-beta.5"
},
Bundler will then error on Invariant violation: ... You may have multiple copies of React loaded.
A bit of a damned if I do, damned if I don't on getting react dependency in inside the package? Either none found, or there's 2 copies.
I made a hack fix as workaround around both errors, by replacing all instances inside the package of
var React = require('react');
with
var React = require('[HOMEDIR]/Documents/code/[PROJECT]/node_modules/react');
I hardcoded the react path to the exact copy of react my main app (PROJECT) imports, which avoids not able to resolve module react. I have to alter a sub module inside the package too: react-native-webview-bridge-RN0.40/node_modules/create-react-class/index.js which imports React, which makes this doubly hacky and prone to overwritten.
If there's a less dirty workaround, I'm all ears.
What is the expected behavior?
react not needed as a dependency in a local package (my fork of https://github.com/alinz/react-native-webview-bridge), nor is my hack fix needed to import directly from main app's node_modules/, and bundling goes through without error when react-native run-ios is run.
$ react-native info
Environment:
OS: macOS Sierra 10.12.6
Node: 8.6.0
Yarn: 1.2.0
npm: 5.3.0
Watchman: 4.9.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.3 => 0.49.3
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Bug. I'm not sure if I should file this with React Native instead/in addition, but since the errors I encounter since upgrading from RN 0.48 to 0.49 are all bundling errors in cli, here it is.
What is the current behavior?
From
yarn outdated
of my local package:With RN up to 0.48, my app's inclusion and import of
react-native-webview-bridge
like above works without issue. The package has no dependency itself ofreact
.Since upgrading to RN 0.49.3, this bundling error occurs on running
react-native run-ios
:Then I added
react
as a dependency inpackage.json
, like so:Bundler will then error on
Invariant violation: ... You may have multiple copies of React loaded.
A bit of a damned if I do, damned if I don't on getting
react
dependency in inside the package? Either none found, or there's 2 copies.I made a hack fix as workaround around both errors, by replacing all instances inside the package of
with
I hardcoded the react path to the exact copy of react my main app (PROJECT) imports, which avoids not able to resolve module react. I have to alter a sub module inside the package too:
react-native-webview-bridge-RN0.40/node_modules/create-react-class/index.js
which importsReact
, which makes this doubly hacky and prone to overwritten.If there's a less dirty workaround, I'm all ears.
What is the expected behavior?
react
not needed as a dependency in a local package (my fork of https://github.com/alinz/react-native-webview-bridge), nor is my hack fix needed to import directly from main app's node_modules/, and bundling goes through without error whenreact-native run-ios
is run.$ react-native info
The text was updated successfully, but these errors were encountered: