jamesisaac / react-native-background-task

Periodic background tasks for React Native apps, cross-platform (iOS and Android), which run even when the app is closed.
MIT License
1.1k stars 111 forks source link

Cannot find module 'react-native-background-task' #83

Open jdanl89 opened 4 years ago

jdanl89 commented 4 years ago

After running npm install react-native-background-task --save, I am trying to import BackgroundTask from 'react-native-background-task', but I get Cannot find module 'react-native-background-task' or its corresponding type declarations.

The package was added successfully. I see it in my node_modules and package.json ("react-native-background-task": "^0.2.1",)

OsamaMukhtar commented 4 years ago

Same issue with me. Did you find a fix for it?

angelod1as commented 3 years ago

Any solution to this?

Heltonphg commented 3 years ago

Same issue with me.

vestronv commented 2 years ago

Please do npm run react-native run-android or npx react-native run-android after adding any package we need to re-install it on device.

OsamaElsherif commented 2 years ago

Actually I figured out why that is happening, but I couldn't get a solution for it, yet. If you go to react-native-background-task project in node_modules foleds, you will find the both of Types,js and Android.js files have a typescript code in it, and if you commented the import and re-typed the file in js Just a few changes, there will not be any errors while using the BackgroundTask

😂😂😂😂😂 But for in the same time the Task didn't worked for me as well, I think we need the both files to be converted to JS, and I will try doing that after finishing the project I am working on. So if there is another errors and tweaks you'd made, I wish you will tell me.

fukemy commented 1 year ago

ok, decided to removed this bad lib