Open jan-ambroz opened 3 years ago
Hi @johnW6
What's your library version, I'm not able to reproduce.
Regards,
HI @Dallas62 ,
I am using "^6.1.3"
Hum, this is really strange, you are the first one which is opening this kind of issue.
Did you try to reinstall dependencies ?
I did now, yarn remove, yarn add and I am still getting:
/home/jan/code/my-project/NotificationService.js Attempted import error: 'react-native-push-notification' does not contain a default export (imported as 'PushNotification').
and my all dependencies:
`"dependencies": {
"expo": "~40.0.0",
"expo-splash-screen": "~0.8.0",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-gesture-handler": "~1.8.0",
"react-native-push-notification": "^7.0.0",
"react-native-reanimated": "~1.13.0",
"react-native-screens": "~2.15.0",
"react-native-unimodules": "~0.12.0",
"react-native-web": "~0.13.12"
},`
When I try to run it in browser i am getting:
TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Module.<anonymous>
node_modules/react-native-push-notification/index.js:609
606 | return this.callNative('setNotificationCategories', arguments);
607 | }
608 |
> 609 | module.exports = Notifications;
610 |
Which platform are you using ? This library is made for iOS and Android, not web.
Yeah I am trying to run it in Android. There I have still error about import.
This seems to be an issue with your metro bundler / compiler
hey @jan-ambroz I had the same error, did you find solution for that?
hey @jan-ambroz I had the same error, did you find solution for that?
no, i just switch to Flutter.
Bug
Trying to import PushNotifications but always getting error about missing default export.
Code:
error
Attempted import error: 'react-native-push-notification' does not contain a default export (imported as 'PushNotification').