Parse-sdk-js: Unable to resolve module 'EventEmitter' - React Native 0.61.1

Created on 30 Sep 2019  路  12Comments  路  Source: parse-community/Parse-SDK-JS

Issue Description

After upgrading from react-native v0.60.4 to v0.61.1 I receive a red screen where parse is unable to location EventEmitter in the project.

Using parse version 2.7.1.

Nothing else was changed between 0.60.4 => 0.61.1

Steps to reproduce

  1. Upgrade react native using https://react-native-community.github.io/upgrade-helper/
  2. yarn
  3. pod install
  4. react-native run-ios
  5. Start the packager

Expected Results

Manage to start the app

Actual Outcome

Screenshot 2019-09-30 at 13 40 29

Environment Setup

  • JS SDK

    • JS SDK version: 2.7.1

    • Application? (Browser, Node, React-Native, etc): RN0.61.1

bug needs investigation

Most helpful comment

TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "../../../react-native/Libraries/vendor/emitter/EventEmitter").prototype.addListener')

I've been stuck on this for a couple hours. Can anyone point me in the right direction? Worked before adding @types/parse. Not working after removing the package though.

Only happens on react-native 0.64.0; 0.63.3 works fine.

go to the file:

node_modules\parse\lib\react-native\EventEmitter.js

and change this line:

var EventEmitter = require('../../../react-native/Libraries/vendor/emitter/EventEmitter');

to this:

import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';

Only solution that worked, for me, I have been pulling my hair out over this issue for 5 days. No solutions online.

All 12 comments

same here

Whats the status on this is there a fix?

this fixed my problem:

go to the file:

node_modules\parse\lib\react-native\EventEmitter.js

and change this line:

const EventEmitter = require('EventEmitter');

to this:

const EventEmitter = require('../../../react-native/Libraries/vendor/emitter/EventEmitter');

When will we publish this update?

Yeah we really need this, I hope we can get this published soon.

There are a few PR's opened, once they are reviewed we can do a release.

I'll draft one right now.

In the meantime you can build the project or the latest branch.

https://github.com/parse-community/Parse-SDK-JS#want-to-ride-the-bleeding-edge

I have a same problem here.

@DurandSacha can you open a new issue and fill out the template as much as possible

TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "../../../react-native/Libraries/vendor/emitter/EventEmitter").prototype.addListener')

I've been stuck on this for a couple hours. Can anyone point me in the right direction? Worked before adding @types/parse. Not working after removing the package though.

Only happens on react-native 0.64.0; 0.63.3 works fine.

TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "../../../react-native/Libraries/vendor/emitter/EventEmitter").prototype.addListener')

I've been stuck on this for a couple hours. Can anyone point me in the right direction? Worked before adding @types/parse. Not working after removing the package though.

Only happens on react-native 0.64.0; 0.63.3 works fine.

go to the file:

node_modules\parse\lib\react-native\EventEmitter.js

and change this line:

var EventEmitter = require('../../../react-native/Libraries/vendor/emitter/EventEmitter');

to this:

import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';

Only solution that worked, for me, I have been pulling my hair out over this issue for 5 days. No solutions online.

For what it's worth I'm using TypeScript, [email protected] and @maidrissi solution worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fdidron picture fdidron  路  4Comments

dblythy picture dblythy  路  4Comments

oallouch picture oallouch  路  4Comments

Gyran picture Gyran  路  5Comments

ryanemax picture ryanemax  路  7Comments