react-native-background-task icon indicating copy to clipboard operation
react-native-background-task copied to clipboard

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

Open jdanl89 opened this issue 5 years ago • 6 comments

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",)

jdanl89 avatar Jul 09 '20 22:07 jdanl89

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

OsamaMukhtar avatar Jul 28 '20 10:07 OsamaMukhtar

Any solution to this?

angelod1as avatar Dec 02 '20 21:12 angelod1as

Same issue with me.

Heltonphg avatar Jan 14 '21 11:01 Heltonphg

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.

vestronv avatar Sep 02 '21 11:09 vestronv

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.

OsamaElsherif avatar Aug 09 '22 15:08 OsamaElsherif

ok, decided to removed this bad lib

fukemy avatar Nov 07 '22 07:11 fukemy