TheWidlarzGroup / react-native-notificated

⚡️React Native toast notifications
https://thewidlarzgroup.github.io/react-native-notificated/
MIT License
373 stars 21 forks source link

[BUG] After upgrade version from 0.1.0 to newer, expo web crashes #249

Closed micbaumr closed 4 months ago

micbaumr commented 9 months ago

Prerequisites Please answer the following questions for yourself before submitting an issue.

Describe the bug I'm using expo to build android, ios and web app. After upgrading react-native-notificated from 0.1.0 version to 0.1.1 or higher I got error :

Uncaught Error: Your web project is importing a module from 'react-native' instead of 'react-native-web'. Learn more: https://expo.fyi/fb-batched-bridge-config-web
    at get (Expo.fx.web.tsx:12:1)
    at ./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js (NativeModules.js:181:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/react-native/Libraries/TurboModule/TurboModuleRegistry.js (TurboModuleRegistry.js:15:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/react-native/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js (NativeModules.js:210:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)

To Reproduce Steps to reproduce the behavior:

  1. Run expo project with react-native-notificated version 0.1.0
  2. Bump react-native-notificated to version 0.1.1
  3. See error

Expected behavior Running in web browser without an error

Screenshots

Screenshot 2023-12-20 at 12 57 29

Smartphone (please complete the following information):

PdoubleU commented 9 months ago

Hey @micbaumr, thanks for bringing this error to our attention. We'll work on fixing it as soon as possible and get back to you with an update.

mtzfactory commented 4 months ago

Hi! I'm facing the very same problem. I'm using Expo with expo-router

Screenshot 2024-05-15 at 15 21 31

This is my package.json file:

    "expo": "^49.0.0",
    "expo-blur": "~12.4.1",
    "expo-clipboard": "~4.3.0",
    "expo-constants": "~14.4.2",
    "expo-device": "~5.4.0",
    "expo-font": "~11.4.0",
    "expo-image-picker": "~14.3.2",
    "expo-linear-gradient": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-localization": "~14.3.0",
    "expo-router": "~2.0.0",
    "expo-status-bar": "~1.6.0",
    ...
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.1",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-notificated": "^0.1.5",
    "react-native-reanimated": "~3.3.0",
    ...

@PdoubleU have you had time to review this problem?

I've tried to upgrade this library to use react-native-web but had no success... still having the same problem... @micbaumr did you find a solution?

Thank you!

danielmark0116 commented 4 months ago

here is a PR with a fix:

https://github.com/TheWidlarzGroup/react-native-notificated/pull/266

It's going to be released soon but before that, you can always try to install directly from the branch for the time being

Let me know if issue is gone! :)