kenjdavidson / react-native-bluetooth-classic

⚛ Bluetooth classic Android(Bluetooth)/IOS(ExternalAccessory) module for serial communication
https://kenjdavidson.github.io/react-native-bluetooth-classic
MIT License
250 stars 94 forks source link

Unable to resolve module ../../react-native/types/index #298

Closed maartenvandillen closed 10 months ago

maartenvandillen commented 10 months ago

Mobile Device Environment All, it is a javascript error

Application Environment Provide information about your development environment:

Describe the bug ModuleResolver cannot find javascript import in file lib/index.js: import { NativeModules } from "../../react-native/types/index";

and in lib/BluetoothModule.js import { NativeEventEmitter, Platform } from "../node_modules/react-native/types/index";

To Reproduce Steps to reproduce the behavior:

  1. Add package to project
  2. Run project

Expected behavior Project builds

Additional context Fixed by changing imports to: import { NativeModules } from "react-native"; and import { NativeEventEmitter, Platform } from "react-native";

kenjdavidson commented 10 months ago

Rnvc 73 is not compatible with react 72. Use the older 0.60 version. See the matrix on the Readme.

kenjdavidson commented 10 months ago

Or I messed things up when fixing the typescript errors to get it to compile. Either way I'd give the older version a try with react native 72.

maartenvandillen commented 10 months ago

Ok I will try that. Will I be missing out on bug fixes or new features? If so, I can live with the patched version I have right now.

kenjdavidson commented 10 months ago

No.

But if you've fixed it locally. Open a pr.

kenjdavidson commented 10 months ago

I think I fixed the typing issue with react-native that I introduced when attempting to both merge the update and resolve outdated libraries. Anyhow, no more TS issues and it looks like the import statements are correct now.