Closed iAmWillShepherd closed 2 years ago
Installing vue
doesn't completely solve the problem, the OneSignal plugin emits a warning stating that no default export was found in vue
.
vue
WARNING Compiled with 1 warning 10:23:26 AM
warning in ./node_modules/onesignal-vue/dist/index.js
"export 'default' (imported as 'Vue') was not found in 'vue'
App running at:
- Local: http://localhost:8080/
- Network: http://192.168.2.124:8080/
Some other issues I encountered:
OneSignal
within a Vue component<script>
import OneSignal from 'onesignal-vue'
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'App',
components: {
HelloWorld
},
beforeCreate() {
this.$OneSignal.showSlidedownPrompt()
}
}
</script>
Here is my main.js
file where I set up OneSignal.
import { createApp } from 'vue'
import OneSignal from '@onesignal/onesignal-vue3'
import App from './App.vue'
import { _OneSignalAppId_ } from './common/constants'
const app = createApp(App, {
productionTip: false
})
app.use(OneSignal, {
appId: _OneSignalAppId_,
allowLocalhostAsSecureOrigin: true
})
app.mount('#app')
@jmadler thinks this may be a packaging issue, a good starting point for root-cause analysis (RCA).
Hello, Thank you.
Installing the onesignal-vue plugin resolves the issue, but we should either State that onesignal-vue is required in addition to @onesignal/onesignal-vue3 or Install the dependency as part of @onesignal/onesignal-vue3's installation
onesignal-vue
is not required for onesignal-vue3
.
Make sure you're not mixing them up.
import OneSignal from 'onesignal-vue'
Make sure you're importing from 'onesignal-vue3' as they are different.
No code hinting, even when I import OneSignal within a Vue component
Are you using Vetur?
may be a packaging issue
I don't think so. See my comments above for guidance.
Closing since this is tracked internally
Updating the package worked (https://github.com/OneSignalDevelopers/onesignal-vue3-sample/commit/25d44266f996e7011d9537b1325c23d203a35512); I no longer get the initialization error, and code-hinting now works!
Everything appears to be working, but I did notice these errors pop up regarding our cookies.
While building the sample app for this, I ran into an issue dealing with OneSignal dependencies. Specifically, I received an error stating that the
onesignal-vue
dependency couldn't be found.Running without installing
oneesignal-vue
firstInstalling the
onesignal-vue
plugin resolves the issue, but we should eitheronesignal-vue
is required in addition to@onesignal/onesignal-vue3
@onesignal/onesignal-vue3
's installation