meteorrn / meteor-react-native

Meteor client for React Native matching Meteor Spec
https://guide.meteor.com/react-native.html
Other
59 stars 31 forks source link

RN 0.71 compatibility #125

Closed odesey closed 1 year ago

odesey commented 1 year ago

Describe the bug I just upgraded a project to RN 0.71.12 from version 0.65.1 and now the the app will not load with the following error:

 ERROR  [Error: undefined Unable to resolve module events from /Users/dev/Documents/Code/App/node_modules/@meteorrn/core/lib/ddp.js: events could not be found within the project or in these directories:
  node_modules/@meteorrn/core/node_modules
  node_modules
> 1 | import { EventEmitter } from 'events';
    |                               ^
  2 | import Queue from './queue';
  3 | import Socket from './socket';
  4 | import { uniqueId } from './utils';]

To Reproduce

  1. create a new RN project using npx react-native init AwesomeProject --version 0.71.12
  2. yarn add @meteorrn/core
  3. Try to launch new RN app

Expected behavior The app should load

Screenshots Screen Shot 2023-07-26 at 2 18 35 PM

Device (please complete the following information):

bratelefant commented 1 year ago

You can easily fix this by installing the required dependency to your project via "npm install events"

odesey commented 1 year ago

Thank you, that fixed the error.

jankapunkt commented 1 year ago

I think we need to add this to the documentation. I did not experienced this issues, simply because expo already uses events. I also wonder, whether it's possible to use node:events instead of events, because events from NPM registry is still only a republish of the node module and may be subject of multiple issues like becoming abandoned etc.