januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
351 stars 411 forks source link

Could not find a declaration file for module 'react-native-bluetooth-escpos-printer' #189

Open andresEximia opened 2 years ago

andresEximia commented 2 years ago

Hello everyone,

I'm developing my first react native app for Android in Visual Studio Code with TypeScript. I followed the installation steps, but when I refer the module in my tsx file I receive the following message:

"Could not find a declaration file for module 'react-native-bluetooth-escpos-printer'. '[PROJECT-NAME]/node_modules/react-native-bluetooth-escpos-printer/index.js' implicitly has an 'any' type."

Thanks in advance!

alihirano commented 2 years ago

I have the same problem, can anyone fix it?

panhavey commented 1 year ago
  1. Create .d.ts file (eg. type.d.ts)
  2. add this line : declare module 'react-native-bluetooth-escpos-printer';
Tamilarasan-ThiDiff commented 1 year ago

I think you are using expo app for run the app you can try with android studio because for this package "Native-Modules" Required , if you use the expo it will not recognize so you can try in android studio