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> Component throws an error if the first expression after defineProps starts with parenthesis #6428

Closed
dha-corey opened this issue Aug 8, 2022 · 0 comments · Fixed by #6461
Labels
feat: compiler feat: script-setup Related to experimental implementation of RFC #227

Comments

@dha-corey
Copy link

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9j7FuwzAMRH9F0JQCsdTZVQz0Dzp01OLaTKogogiSdgfD/16p7RC0QBeCd0c8HDf7TOTWBWxvg0Km26gwRDQmzGkdXkE0+LZFDP4ur1ImTqTmNuLlFK1KtEZAF6rpVFDUEBcSczIznBPCS1OHbX94inh4bDP4b8RgjzZlKqxdHsldpWBts7US8Seo8N58Oc2rdZuO9l2VpPdezlP74Squ8MXXzfGCmjI4kNy9cfkQ4AqO9njH8NVcgTsGnIGB/2P+Ov3Dbdg94m73T5s5deA=

Steps to reproduce

The repro link demonstrates the issue with no action required

What is expected?

The component renders

What is actually happening?

An error is thrown: '__props is not a function'

System Info

No response

Any additional comments?

Close-enough example to how it was discovered. If the first line after defineProps uses a cast wrapped in parentheses to make a TS error go away, it will cause this error: https://sfc.vuejs.org/#eNpNTzFuwzAM/AqhJQnQSLurGOgPCrSjFtWWXQURJYh0jCLw30slGTKRxyOPdzf1UYq+LkF1ynJI5eI59A4B7Biv/XcgtqZ1Dq154QXSUGNhuHicT04xOQUUeCnCDhmJodRcCE4whili+Gxof2vSU84dfHGNODvcDu8O92vEMa/gCTz+HbRsyOFOyk5Yax6/evWmYiq58jH5os+UUWzfJd2TEBcd3CdtJrkaduqXuVBnDE1DC3smnetspNN1QY4p6EDp+FPzSqGKsFNNYhN3avsHxFtk2w==

Naively, it looks like the generated source is just missing a semicolon after __props.

const props = __props

(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: compiler feat: script-setup Related to experimental implementation of RFC #227
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants