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
Have a property binding in a template that explicitly used the value undefined AND an inline comment:
<p :id="undefined/* force override the id */">This bugs out</p>
What is expected?
The value undefined is passed to the component or element.
What is actually happening?
The build fails with this error message:
error during build:
[vite:vue] Cannot read properties of null (reading 'type')
file: […]/src/components/TheComponent.vue
at […]/node_modules/@vue/compiler-dom/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:4283:48
[…]
Or sometimes on Stackblitz:
[plugin:vite:vue] parent is null
/home/projects/vitejs-vite-k1clft/src/App.vue
System Info
No response
Any additional comments?
We use this to override specific properties passed using a v-bind. We pass undefined and add a comment why, as overriding something is mostly a workaround for a third-party-library.
<AComponentv-bind="CommonPropsObject"
:specific-prop="undefined/* do not pass specificProp to avoid abc and xyz */"
/>
This is effectively equivalent to:
<AComponentv-bind="{...CommonPropsObject, specificProp:undefined/* do not pass specificProp to avoid abc and xyz */ }"
/>
The text was updated successfully, but these errors were encountered:
Vue version
>=3.4.26
(worked fine until 3.4.25)Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-k1clft
Steps to reproduce
Have a property binding in a template that explicitly used the value
undefined
AND an inline comment:What is expected?
The value
undefined
is passed to the component or element.What is actually happening?
The build fails with this error message:
Or sometimes on Stackblitz:
System Info
No response
Any additional comments?
We use this to override specific properties passed using a
v-bind
. We passundefined
and add a comment why, as overriding something is mostly a workaround for a third-party-library.This is effectively equivalent to:
The text was updated successfully, but these errors were encountered: