OneSignal / onesignal-expo-plugin

The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
Other
156 stars 50 forks source link

[Bug]: withAndroidBaseMods.ts:11 Uncaught TypeError: Cannot read properties of undefined (reading 'readFile') at ./node_modules/@expo/config-plugins/build/plugins/withAndroidBaseMods.js #147

Closed Ferna105 closed 1 year ago

Ferna105 commented 1 year ago

What happened?

Hello, Im trying to use "onesignal-expo-plugin" based on this documentation https://github.com/OneSignal/onesignal-expo-plugin

but when I tried to import Onesignal in my app.js the app crashed

withAndroidBaseMods.ts:11 Uncaught TypeError: Cannot read properties of undefined (reading 'readFile') at ./node_modules/@expo/config-plugins/build/plugins/withAndroidBaseMods.js (withAndroidBaseMods.ts:11:1) at webpack_require (bootstrap:789:1) at fn (bootstrap:100:1) at _withAndroidBaseMods (index.ts:7:1) at ./node_modules/@expo/config-plugins/build/index.js (index.ts:63:1) at webpack_require (bootstrap:789:1) at fn (bootstrap:100:1) at ./node_modules/onesignal-expo-plugin/build/onesignal/withOneSignalAndroid.js (withOneSignalAndroid.js:8:1) at webpack_require__ (bootstrap:789:1) at fn (bootstrap:100:1) at ./node_modules/onesignal-expo-plugin/build/onesignal/withOneSignal.js (withOneSignal.js:7:1) at webpack_require (bootstrap:789:1) at fn (bootstrap:100:1) at ./node_modules/onesignal-expo-plugin/app.plugin.js (app.plugin.js:1:1) at __webpack_require (bootstrap:789:1) at fn (bootstrap:100:1) at ./App.tsx (App.tsx:1:1) at webpack_require__ (bootstrap:789:1) at fn (bootstrap:100:1) at ./node_modules/expo/AppEntry.js (AppEntry.js:1:1) at webpack_require (bootstrap:789:1) at fn (bootstrap:100:1) at 1 (index.tsx:58:1) at webpack_require__ (bootstrap:789:1) at bootstrap:856:1 at bootstrap:856:1

Steps to reproduce?

1- Create an expo managed app with Expo sdk 47
2- install with npm onesignal-expo-plugin and follow the instructions
3- Try to import on app.js

What did you expect to happen?

The package works correctly Captura de pantalla (5)

OneSignal Expo SDK version

Package: 1.2.0 Node: v18.12.1 Expo SDK: 47.0.6 React Native: 0.70.5

Platform

No response

Relevant log output

Uncaught TypeError: Cannot read properties of undefined (reading 'readFile')
    at ./node_modules/@expo/config-plugins/build/plugins/withAndroidBaseMods.js (withAndroidBaseMods.ts:11:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at _withAndroidBaseMods (index.ts:7:1)
    at ./node_modules/@expo/config-plugins/build/index.js (index.ts:63:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/onesignal-expo-plugin/build/onesignal/withOneSignalAndroid.js (withOneSignalAndroid.js:8:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/onesignal-expo-plugin/build/onesignal/withOneSignal.js (withOneSignal.js:7:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/onesignal-expo-plugin/app.plugin.js (app.plugin.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./App.tsx (App.tsx:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at ./node_modules/expo/AppEntry.js (AppEntry.js:1:1)
    at __webpack_require__ (bootstrap:789:1)
    at fn (bootstrap:100:1)
    at 1 (index.tsx:58:1)
    at __webpack_require__ (bootstrap:789:1)
    at bootstrap:856:1
    at bootstrap:856:1

Code of Conduct

brismithers commented 1 year ago

Hi @Ferna105. In addition to the onesignal-expo-plugin package, are you also including the react-native-onesignal package? If so, can you tell me which version you have? Thanks!

brismithers commented 1 year ago

@Ferna105 just checking in to see if above resolved your issue?