Skip to content

Destructuring props no longer works without experimental features #8289

Closed
@Lehoczky

Description

@Lehoczky

Vue version

3.3

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-hbtqav?file=src/App.vue

Steps to reproduce

Open the example in a new tab to see the console.log's.

You can see that the destructured variable in the Works component has been logged, but the one in the NotWorks component is undefined.

What is expected?

Both props are available. This worked below 3.3

What is actually happening?

Looking at nuxt/nuxt#20789 and nuxt/nuxt#20795 it seems like when we do not enable reactivity transform or the new props destructuring feature, then the destructured props are just lost after compilation.

Probably related to this code path: https://github.com/vuejs/core/blob/main/packages/compiler-sfc/src/script/definePropsDestructure.ts#L31

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions