Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Running against localhost with our app-id #32

Closed
BramDecuypere opened this issue Aug 18, 2023 · 5 comments
Closed

[Bug]: Running against localhost with our app-id #32

BramDecuypere opened this issue Aug 18, 2023 · 5 comments

Comments

@BramDecuypere
Copy link

BramDecuypere commented Aug 18, 2023

How can we help?

The vue plugin we are using is combined with a vitesse app (I don't believe this impacts anything)

  • I've tried running it in an incognito as well, but unsuccessfully
  • Also tried creating a fresh app through the admin app, but still having the same issue.
  • The weird thing is that (the same organisation different app) still works on our remotely build app, so my guess would be it's the localhost setting?

But now trying to create a new app it seems to not work on localhost.
Below is the config.

Screenshot 2023-08-18 at 13 58 38

This is the error I get, I haven't found anything, so not sure it's a bug or a question in this case

Here is the error I got, when trying to understand it (it seems to be in the library itself?), but I don't have a reason for it.
Screenshot 2023-08-18 at 13 59 20

Here is the code I got too while trying to debug:
Screenshot 2023-08-18 at 14 00 47

@BramDecuypere BramDecuypere changed the title [Question]: Running against local host [Question || Bug]: Running against local host Aug 18, 2023
@BramDecuypere BramDecuypere changed the title [Question || Bug]: Running against local host [Question || Bug]: Running against localhost Aug 18, 2023
@jkasten2
Copy link
Member

@BramDecuypere I am not able to reproduce this issue.

My attempt at reproducing issue

1. Created new Vue3 project

npm create [email protected] vue3-OneSignal-test
Add TypeScript?  Yes
Add JSX Support? No
Add Vue Router for Single Page Application development? / Yes
Add Pinia for state management?  No
 Add Vitest for Unit Testing?  Yes
Add an End-to-End Testing Solution? › No
Add ESLint for code quality? Yes
Add Prettier for code formatting? Yes

cd vue3-OneSignal-test
npm install
npm run format
npm run dev

2. Install OneSignal

npm install --save @onesignal/onesignal-vue3

3. Add OneSignal code

Added OneSignal to src/main.ts. Full code for this file:

import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import OneSignalVuePlugin from '@onesignal/onesignal-vue3'

const app = createApp(App)

// Initialize OneSignal
app.use(
  OneSignalVuePlugin,
  {
    appId: 'df886d95-7bd2-48b0-9d3a-abb24d2746ac',
  }
);

app.use(router)
app.mount('#app')

Question

Can you share how and where you are initializing OneSignal?

  • Please provide steps like about to reproduce if possible.

@BramDecuypere
Copy link
Author

BramDecuypere commented Aug 21, 2023

@jkasten2 thanks for the help!

Followed your exact setup. (Initially thought it might be our setup) But it seems it's really with our app-id/account related.
Since I believe the app-id isn't sensitive info, could it be that it has to do something with our account? We did remove an app and added something similar. Not sure of course how that might work.

If the app-id IS sensitive, please do let me know so I can remove it

34f47e70-1c71-478a-bcbb-7272014874a4

Screenshot 2023-08-21 at 15 15 15

Screenshot 2023-08-21 at 15 19 48

PS: Editing my code to the app-id you used in your setup - df886d95-7bd2-48b0-9d3a-abb24d2746ac makes me get the last image.

Screenshot 2023-08-21 at 15 38 33

@BramDecuypere BramDecuypere changed the title [Question || Bug]: Running against localhost [Bug]: Running against localhost with our app-id Aug 21, 2023
@BramDecuypere
Copy link
Author

[UPDATE] - it randomly started working, still has the issue on some loads.

@jkasten2
Copy link
Member

The "TypeError: Cannot read properties of undefined (reading 'message')" is due to your app being configured as HTTP instead of HTTPS. The v2 of this plugin only supports HTTPS, see this comment for more details.

@BramDecuypere
Copy link
Author

@jkasten2 but shouldn't that be solved with the option of "local testing - treat http as HTTPS"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants