Subscribe on changes!

dev&build the props data.value is different

avatar
Mar 18th 2023

Vue version

3.2.47

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-bd8vyx?file=src/components/Parent.vue

Steps to reproduce

illustrate:

https://stackblitz.com/edit/vitejs-vite-bd8vyx?file=src/components/Parent.vue

the ChildDev.vue and ChildBuild.vue only formData.value is not different

the ChildDev.vue only can use in dev mode;

the ChildBuild.vue only can use after build;

When in dev mod: formData.value is not required, plus .value is invalid

After build: formData.value is required, otherwise it is invalid. . . .

What is expected?

the dev mode and build is same

What is actually happening?

the dev mode show errors and the build is normal

System Info

No response

Any additional comments?

No response

avatar
Mar 18th 2023

Your props definition is invalid. You cant define the shape of the object being passed.

Please read up in the docs and/or ask the community for help

avatar
Mar 19th 2023

@LinusBorg Even if there is a problem with the definition, dev and build should report the same error. Why is it normal in dev mode, but an error is reported after build?

avatar
Mar 19th 2023

fixed by myself, props.formData uses reactive again, which leads to no warning or error in dev mode, but an error will occur after build