You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a Vue project, when an html end tag is missing/wrongly formatted, the following error is thrown:
[vite] Internal server error: Cannot read property 'line' of undefined
Plugin: vite:vue
File: repro/src/components/HelloWorld.vue
at createRollupError (repro\node_modules\@vitejs\plugin-vue\dist\index.js:4167:29)
at repro\node_modules\@vitejs\plugin-vue\dist\index.js:4448:51
at Array.forEach (<anonymous>)
at transformMain (repro\node_modules\@vitejs\plugin-vue\dist\index.js:4448:12)
at TransformContext.transform (repro\node_modules\@vitejs\plugin-vue\dist\index.js:4805:16)
at Object.transform (repro\node_modules\vite\dist\node\chunks\dep-e0fe87f8.js:42396:53)
at async doTransform (repro\node_modules\vite\dist\node\chunks\dep-e0fe87f8.js:56801:29)
Instead of:
[vite] Internal server error: Element is missing end tag.
Plugin: vite:vue
File: repro/src/components/HelloWorld.vue
at createCompilerError (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:19:19)
at emitError (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1600:29)
at parseElement (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1152:9)
at parseChildren (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:943:28)
at parseElement (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1131:22)
at parseChildren (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:943:28)
at parseElement (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1131:22)
at parseChildren (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:943:28)
at Object.baseParse (repro\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:858:23)
at Object.parse (repro\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:3060:25)
When I first run vite it happens that the correct error is displayed but after a refresh or hot reload the other one will be displayed.
Seems to be thrown from /vite/packages/plugin-vue/src/utils/error.ts at line 14 & 15 because the error argument doesn't have the property start, works on my side if I directly remove the start level.
[vite] Internal server error: Cannot read property 'line' of undefined
Plugin: vite:vue
File: repro/src/components/HelloWorld.vue
at createRollupError (repro\node_modules\@vitejs\plugin-vue\dist\index.js:4167:29)
at repro\node_modules\@vitejs\plugin-vue\dist\index.js:4448:51
at Array.forEach (<anonymous>)
at transformMain (repro\node_modules\@vitejs\plugin-vue\dist\index.js:4448:12)
at TransformContext.transform (repro\node_modules\@vitejs\plugin-vue\dist\index.js:4805:16)
at Object.transform (repro\node_modules\vite\dist\node\chunks\dep-e0fe87f8.js:42396:53)
at async doTransform (repro\node_modules\vite\dist\node\chunks\dep-e0fe87f8.js:56801:29) (x2)
vite:time 50.90ms /src/components/HelloWorld.vue +29ms
vite:time 0.81ms /favicon.ico +15ms
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Describe the bug
On a Vue project, when an html end tag is missing/wrongly formatted, the following error is thrown:
Instead of:
When I first run
vite
it happens that the correct error is displayed but after a refresh or hot reload the other one will be displayed.Seems to be thrown from
/vite/packages/plugin-vue/src/utils/error.ts
at line 14 & 15 because theerror
argument doesn't have the propertystart
, works on my side if I directly remove thestart
level.Reproduction
https://github.com/hidewak/repro-vite-plugin-vue
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: