Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.9k
Description
Vue version
min. 3.5.19
Link to minimal reproduction
https://github.com/dbohn/vue-type-union-regression
Steps to reproduce
After checking out the reproduction repository, run
npm installnpm run buildPlease note, that this issue persists up to the latest patch version. This can be checked by increasing the patch version in thepackage.json file and run the above steps again.
What is expected?
Up to Vue 3.5.18, the build succeeded without any issues, asright-end is a valid value of the importedPlacement type.
What is actually happening?
Build fails with the following error:
error during build:[vite:vue] [@vue/compiler-sfc] Default value of prop "placement" does not match declared type./.../vue-floating-default/src/components/HelloWorld.vue3 | import { ref } from 'vue'4 |5 | const {placement = 'right-end'} = defineProps<{ msg: string, placement?: Placement }>() | ^^^^^^^^^^^6 |7 | const validPlacement: Placement = 'right-end';System Info
System: OS: Linux 6.6 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat) CPU: (22) x64 Intel(R) Core(TM) Ultra 7 155H Memory: 4.56 GB / 15.37 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 22.14.0 -~/.nvm/versions/node/v22.14.0/bin/node npm: 10.9.2 -~/.nvm/versions/node/v22.14.0/bin/npm npmPackages: vue: 3.5.19 => 3.5.19
Any additional comments?
We have a set of components, that usefloating-ui for positioning. We are using a similarplacement parameter in these components to set the initial positioning of our floating component.
After updating to the latest patch version of Vue, we ran into these issues.
Interestingly, thevue-tsc invocation within the build command does not produce an error here.