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

"TS1005: ',' expected" in component :is object literal #3171

Closed
Tracked by #17282
KaelWD opened this issue May 11, 2023 · 3 comments · Fixed by #3324
Closed
Tracked by #17282

"TS1005: ',' expected" in component :is object literal #3171

KaelWD opened this issue May 11, 2023 · 3 comments · Fixed by #3324
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@KaelWD
Copy link

KaelWD commented May 11, 2023

<template>
  <div>
    <component :is="{ render: eventSummary }" />
  </div>
</template>

<script setup lang="ts">
  import { h } from 'vue'

  const eventSummary = () => h('div')
</script>

worked in 1.4.4, fixed in 1.6.0, broken again in 1.6.4

generated code is

const __VLS_4 = { __VLS_ctx.render: __VLS_ctx.eventSummary };

should be

const __VLS_4 = { render: __VLS_ctx.eventSummary };
@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Jun 25, 2023
@so1ve
Copy link
Member

so1ve commented Jun 25, 2023

Confirmed broken in 1.5.3

@so1ve
Copy link
Member

so1ve commented Jun 25, 2023

Introduced in b535f6f

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Jun 26, 2023

#3324 fixes parsing, but we won't try to infer { render }, you need to wrap it as defineComponent({ render: eventSummary }), or just use :is="eventSummary".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants