Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script setup "withDefaults" generates wrong code #4510

Closed
sheremet-va opened this issue Sep 3, 2021 · 1 comment
Closed

Script setup "withDefaults" generates wrong code #4510

sheremet-va opened this issue Sep 3, 2021 · 1 comment

Comments

@sheremet-va
Copy link

Version

3.2.8

Reproduction link

github.com

Steps to reproduce

  1. Create file with script setup
  2. paste
withDefaults(
  defineProps<{
    phones: Stored<Phone[]>;
    title?: string;
    callable?: boolean;
  }>(),
  {
    title: "Телефоны",
  }
);

To reproduce with git reproduction, run npm run build after npm install

What is expected?

compiled code:

const props = __props as { phones: Stored<Phone[]>, title: string, callable?: boolean }

What is actually happening?

compiled code:

const props = __props as { phones: Stored<Phone[]>;, title: string, callable?: boolean; }

esbuild is giving me this error, but it goes from wrong compiled code

@posva
Copy link
Member

posva commented Sep 3, 2021

Duplicate of #4505

@posva posva marked this as a duplicate of #4505 Sep 3, 2021
@posva posva closed this as completed Sep 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants