qrcode-vue3
qrcode-vue3 copied to clipboard
self is not defined
ReferenceError: self is not defined
at Object.
Any update on this? I have the same issue...
same here on ssr.
Same here. We're running the project locally as an SPA but it'll be SSR when it hits prod. The person who initially did the work has devved it with no issues but when we check out their branch and try to run the project, we see this error.
I added the following to nuxt.config.ts
:
export default defineNuxtConfig({
plugins: [
{ src: '~/plugins/qrcode-vue3', ssr: false, mode: 'client' },
],
...
})
While my plugins/qrcode-vue3.ts
looks like this:
import QRCodeVue3 from "qrcode-vue3";
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component("QRCodeVue3", QRCodeVue3);
})
It works for me. I'm guessing it does not work with SSR, but it's good enough for me. (stole solution from here)
I added the following to
nuxt.config.ts
:export default defineNuxtConfig({ plugins: [ { src: '~/plugins/qrcode-vue3', ssr: false, mode: 'client' }, ], ... })
While my
plugins/qrcode-vue3.ts
looks like this:import QRCodeVue3 from "qrcode-vue3"; export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.component("QRCodeVue3", QRCodeVue3); })
It works for me. I'm guessing it does not work with SSR, but it's good enough for me. (stole solution from here)
This looks promising! I'll try and give it a go when I can, thanks :)
I noticed it gives a warning. Don't know how to remove it :/
But it does work