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

self is not defined #10

Open
ArgekarStudios opened this issue Feb 3, 2022 · 6 comments
Open

self is not defined #10

ArgekarStudios opened this issue Feb 3, 2022 · 6 comments

Comments

@ArgekarStudios
Copy link

ReferenceError: self is not defined
at Object. (/node_modules/.pnpm/[email protected][email protected]/node_modules/qrcode-vue3/lib/index.js:1:248)

@waysagency
Copy link

Any update on this? I have the same issue...

@wwwDESIGN-basti
Copy link

same here on ssr.

@Katie-Adams
Copy link

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.

@KyleSmith0905
Copy link

KyleSmith0905 commented May 3, 2023

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)

@Katie-Adams
Copy link

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 :)

@KyleSmith0905
Copy link

KyleSmith0905 commented May 4, 2023

I noticed it gives a warning. Don't know how to remove it :/

But it does work

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

5 participants