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

document is not defined in Nuxt, even if I use <client-only> #27

Open
radislaw opened this issue Jan 27, 2020 · 3 comments
Open

document is not defined in Nuxt, even if I use <client-only> #27

radislaw opened this issue Jan 27, 2020 · 3 comments

Comments

@radislaw
Copy link

I use vue-qr-reader in Nuxt project

<template>
  <client-only>
     <vue-qr-reader @code-scanned="getQrContent" />
  </client-only>
</template>

<script>
import VueQrReader from 'vue-qr-reader/dist/lib/vue-qr-reader.umd.js'
...

I have an error: document is not defined

@MartCube
Copy link

I get the same error, did you solved this issue ?

@kmbjz
Copy link

kmbjz commented Oct 6, 2020

export default {
    components: {
      'vue-qr-reader': () => process.browser ? import('vue-qr-reader/dist/lib/vue-qr-reader.umd.js') : null
    }
    ...
}

@william-iq397
Copy link

william-iq397 commented Jan 5, 2023

<ClientOnly> <qrcode-stream @init="onInit()" @decode="onDecode()"></qrcode-stream> </ClientOnly>
import qrcode from "vue3-qrcode-reader"

I get the same error how can I solve it

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

4 participants