Closed rs3d closed 2 years ago
+1
Also happening for me, but with Vite version v2.9.14
, and Vue version v2.7.8
.
I can also reproduce this on
Seems to be related to
as when moving the default export [className]
after the class declaration, everything works nicely.
After updating to vue@2.7.10 the issue is gone: https://stackblitz.com/edit/vue2-vite-starter-th6fyw?file=package.json
@CreMindES This might had fixed it in 2.7.9 according to the changelog: https://github.com/vuejs/vue/pull/12747
Hi,
I'm experiencing a strange issue. Whenever I use
default
as class prop or even as a string likedefaultSomething
in a JS-comment in my .vue-files, the following error shows up:Error:
Deps:
on Windows@11
Update
DEMO: https://stackblitz.com/edit/vue2-vite-starter-gkrjjz?file=src/components/Test.vue Exporting an interface in combination with the string 'defaultXXX' inside a comment shows the error.
I assume that this line is causing the error:
at genScriptCode (\app\node_modules\@vitejs\plugin-vue2\dist\index.cjs:2993:37)
CodescriptCode = options.compiler.rewriteDefault(script.content, "_sfc_main", [...defaultPlugins, ...userPlugins]);