Open Tahul opened 3 years ago
I've updated the reproduction to a CodeSandbox example.
You can visit it here.
The problem seem to happen when the src
attribute from an image is used to point to an image directly:
<img src="/img/test.svg" />
^ This seem to be throwing an error.
<template>
<img :src="src" />
</template>
<script>
export default {
setup() {
return {
src: '/img/test.svg'
}
}
}
</script>
^ This seem to work.
I fixed it temporarily on my repository by doing that:
<img src="~/static/img/test.svg" />
I think this is a bug, or at least an update in the behavior that needs to be document on nuxt-vite docs.
Hi dear @Tahul. Indeed this is related to #7. I think at the moment using nuxt-vite is safe by disabling ssr.
PR welcome to update this in readme checklist.
@pi0 ; https://github.com/nuxt/vite/pull/111
Here is a PR including explanations to work around this issue until this is fixed.
I added it to the "Common issues" section of nuxt-vite documentation.
Versions
nuxt-vite: 0.0.36 nuxt: 2.16.0-26932357.0a988668 (nuxt-edge)
Reproduction
https://codesandbox.io/s/nifty-jones-p9kqf?file=/components/Logo.vue
Description
Had an issue with SVG imports from tags, tried to resolve it using:
Fixed the imports, but I still have failures to resolve components, marked by these error messages:
I don't know if this is an issue or just a misconfiguration from my side, we investigated with @farnabaz but couldn't find the source of this problem.
Also tried installing @nuxt/components just to be sure it wasn't a problem from that side and it didn't solved the problem.
Thank you a lot for your help, amazing work on nuxt-vite, can't wait to use it on this project. 🚀