svelte-qrcode
svelte-qrcode copied to clipboard
[BUG] Cannot set properties of undefined
When trying to use your library i get the following error:
Cannot set properties of undefined (setting 'QRious')
TypeError: Cannot set properties of undefined (setting 'QRious')
at /node_modules/svelte-qrcode/src/lib/qrcode/index.js:22:20
at /node_modules/svelte-qrcode/src/lib/qrcode/index.js:23:4
I am running sveltekit next with svelte version ^3.49.0 on vite ^3.0.7
I got the same error. Looking forward to solutions
Same issue here...
Me too
The same error occurred for me.
Cannot set properties of undefined (setting 'QRious')
I found this site.
https://github.com/phippsytech/svelte-qrious
However, it is still not resolved.
+bump
One of the workaround is you can try to dynamically import the component to load it in your svelte page like this:
// QRcomponent.svelte
<script>
import QrCode from 'svelte-qrcode';
export let url;
</script>
<QrCode value="{url}" />
// yourapp.svelte
<script>
let QRcomponent;
onMount(async () => {
try {
QRcomponent = (await import('./QRcomponent.svelte')).default;
} catch (e) {
// do some thing
}
});
</script>
<svelte:component this={QRcomponent} url={mainQuizUrl}/>
Hello, I am developing a new version of the package; I will bring updates soon.