Skip to content

ReactNative - EventEmitter bug #1412

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

Closed
4 tasks done
camdagr8 opened this issue Sep 12, 2021 · 11 comments · Fixed by #1999
Closed
4 tasks done

ReactNative - EventEmitter bug #1412

camdagr8 opened this issue Sep 12, 2021 · 11 comments · Fixed by #1999
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@camdagr8
Copy link

New Issue Checklist

Issue Description

Unable to use Parse in React Native 0.65.1

Steps to reproduce

  1. Create an empty React Native 0.65.1 iOS project
  2. Import Parse React Native: import Parse from 'parse/react-native';

Actual Outcome

Error:

/../node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:15
import type {EventSubscription} from './EventSubscription';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at
 Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/../node_modules/parse/lib/react-native/EventEmitter.js:1:20)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

Environment

  • React Native iOS version: 0.65.1

Client

  • Parse JS SDK version: 3.3.0
@parse-github-assistant
Copy link

Thanks for opening this issue!

  • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.

@camdagr8
Copy link
Author

Please note that I have tried everything in all the related and/or duplicated issues.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Oct 5, 2021
@mtrezza
Copy link
Member

mtrezza commented Oct 18, 2021

@davimacedo should this issue stay in this repo or be moved to the react repo?

@davimacedo
Copy link
Member

This issue belongs to this repo. @camdagr8 are you using cli or expo?

@dplewis
Copy link
Member

dplewis commented Feb 4, 2023

React-Native 0.70.0 Simplified and rewrote the EventEmitter. Can you try updating?

facebook/react-native@e5c5dcd

@ivnnv
Copy link
Contributor

ivnnv commented Feb 13, 2023

For those still having errors with this and landing here (probs because they still on an older version of Parse, like myself)
The API of the rewrote EventEmitter is the same, so it seems to work just patch-patching EventEmitter.js to use the default export:

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

@mtrezza
Copy link
Member

mtrezza commented Aug 27, 2023

@camdagr8, @ivnnv could you test out #1999 and let us know whether is solves the issue before we merge?

@dplewis
Copy link
Member

dplewis commented Aug 29, 2023

@mtrezza Their issues were solved before #1999

@ivnnv Issue was fix by removing the hard-coded path #1930
@camdagr8 Issue should be fixed by updating to the latest version of react-native > 0.70.0. It fixed the typescript import issue.

@mtrezza
Copy link
Member

mtrezza commented Aug 29, 2023

So if this issue has been solved, can we close it? And why is #1999 pointing to this issue if it's solved?

@dplewis
Copy link
Member

dplewis commented Aug 29, 2023

You can close it. I didn’t realized this was solved until just know. Any import issues involving live query is most likely event emitter related.

@mtrezza
Copy link
Member

mtrezza commented Aug 29, 2023

Closing, see explanation above.

So #1999 is actually a new feature that doesn't have an issue yet, right?

@mtrezza mtrezza closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants