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

Pre-bundling questions -- qrcode #1746

Closed
2 tasks done
anncwb opened this issue Jan 27, 2021 · 0 comments
Closed
2 tasks done

Pre-bundling questions -- qrcode #1746

anncwb opened this issue Jan 27, 2021 · 0 comments

Comments

@anncwb
Copy link
Contributor

anncwb commented Jan 27, 2021

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)

Describe the bug

In beta.36, qrcode works normally

<template>
  <div>
    <canvas ref="elRef"></canvas>
  </div>
</template>

<script lang="ts">
  import { defineComponent, ref, nextTick } from 'vue';
  import { toCanvas } from 'qrcode';
  export default defineComponent({
    name: 'App',
    setup() {
      const elRef = ref(null);

      nextTick(() => {
        toCanvas(elRef.value as any, '111');
      });
      return { elRef };
    },
  });
</script>

In beta.50,Console error

TypeError: Cannot read property 'concat' of undefined
    at ReedSolomonEncoder.encode (reed-solomon-encoder.js:38)
    at createCodewords (qrcode.js:340)
    at createData (qrcode.js:286)
    at createSymbol (qrcode.js:424)
    at Object.create (qrcode.js:498)
    at browser.js:53
    at new Promise (<anonymous>)
    at renderCanvas (browser.js:51)
    at App.vue:16

Is this caused by pre-bundling?

Reproduction

System Info

  • vite version: bete.50
  • Operating System: mac
  • Node version: 12
  • Package manager (npm/yarn/pnpm) and version:yarn
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant