Cannot find module 'react-native-background-task'
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",)
Same issue with me. Did you find a fix for it?
Any solution to this?
Same issue with me.
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.
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.
ok, decided to removed this bad lib