Updated my project to RN 0.48.1 and React 16.0.0-alpha.12. The project compiles properly and but now getting red screen of death in the iOS Simulator - both from Xcode and with RN CLI - with the following error message:
Bundling index.ios.js
[development, non-minified, hmr disabled] 98.5% (766/772), failed.
error: bundling failed: "Unable to resolve module react-native/Libraries/EventEmitter/EventEmitter
from /Volumes/VLO/apps/focoapp/app/node_modules/react-native-firebase/lib/modules/base.js
: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
watchman watch-del-all
.node_modules
folder: rm -rf node_modules && npm install
.rm -fr $TMPDIR/react-*
or npm start -- --reset-cache
."Looks like EventEmitter.js was removed from the EventEmitter library as of RN 0.48.
This seems to be the fix - in react-native-firebase/lib/modules/base.js
change
import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
to
import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
Yeah very annoying! That fix will work as a temp workaround in v2 however we can't apply that as it wont be backwards compatible. v3 addresses this when it's released!
Can you release a 2.2 branch for RN 0.48+? :)
@lovince solution works fine. I created a PR #387 for that. You can install this manually by installing this branch:
yarn upgrade 'react-native-firebase@jerolimov/react-native-firebase#eb2ec4b0471865f151b7d32cc0bd7ffe8b314485'
I'm reproducing the same error on bundling/running on simulator. Since RN upgrade to 0.48.1
I'm not seeing this with @jerolimov's PR, but I'm only testing on iOS.
@Salakar What do you want to do about this?
@SoldierCorp This is a different issue, there's plenty of these in the issues.
+1 to 2.2 branch for RN 0.48+
+1
Will release a version in the next hour or so with this patched to support 48 and previous versions, the PR above would break <48
v2.2.0 is up.
i did yarn upgrade
, and made react-native-root-siblings upgrade from 1.2.1 to 1.3.0, and the error raised. then i delete yarn.lock, and did yarn install
, and the error gone.
yarn add react-native-root-toast
to upgrade it from 1.1.2 to 2.2.0 also fix the error
Most helpful comment
Looks like EventEmitter.js was removed from the EventEmitter library as of RN 0.48.
This seems to be the fix - in
react-native-firebase/lib/modules/base.js
changeimport EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
to
import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';