OneSignal / react-onesignal

React OneSignal Module: Make it easy to integrate OneSignal with your React App!
Other
74 stars 23 forks source link

Uncaught (in promise) TypeError: Type error #114

Closed tcetin closed 10 months ago

tcetin commented 1 year ago

How can we help?

I am getting Uncaught (in promise) TypeError: Type error; when try to initialize the OneSignalSDK.

Here is my implementation

        OneSignal.init({
            appId,
            serviceWorkerPath: "OneSignalSDKWorker.js",
            allowLocalhostAsSecureOrigin: true,
            safari_web_id: process.env.NEXT_PUBLIC_SAFARI_WEB_ID
        }).then(() => {
            OneSignal.registerForPushNotifications()
        })

How can I solve this problem?

DavidQuartz commented 12 months ago

Do you still have this problem? Can you provide more context as to what environment you are working in and perhaps a more descriptive error log from a catch block?

jkasten2 commented 10 months ago

@tcetin We will need more information to investigate. I recommend trying the new 3.0.0 version as this may have been fixed there. If not, please open a new issue with more details on your error.