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

Vue 3 with TypeScript - JSX Error when Volar enabled #6719

Closed
kamnakis opened this issue Feb 9, 2022 · 1 comment
Closed

Vue 3 with TypeScript - JSX Error when Volar enabled #6719

kamnakis opened this issue Feb 9, 2022 · 1 comment

Comments

@kamnakis
Copy link

kamnakis commented Feb 9, 2022

Reduced Test Case

Calendar.vue

<template>
  <FullCalendar :options="options" />
</template>

<script lang="ts" setup>
// Components
import FullCalendar, { CalendarOptions } from '@fullcalendar/vue3'

interface Props {
  options: CalendarOptions
}
defineProps<Props>()
</script>

Bug Description

Describe how to recreate the bug.

  1. Create a Quasar v2 project (https://quasar.dev/quasar-cli/installation) with TypeScript
  2. Open project with VSCode and install Volar plugin
  3. npm i @fullcalendar/core @fullcalendar/vue3
  4. Create a Calendar.vue component with the above code.

What do you expect to happen?
Even though it works. I expect typescript to not complain.

What happens instead?
TypeScript complains with this message

JSX element class does not support attributes because it does not have a 'props' property.ts(2607)

'__VLS_2' cannot be used as a JSX component.
  Its instance type '{ $: ComponentInternalInstance; $data: { renderId: number; }; $props: Partial<{}> & Omit<Readonly<{ options?: CalendarOptions | undefined; }> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>; ... 10 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<...> | undefined):...' is not a valid JSX element.ts(2786)

Screenshots

image

@kamnakis
Copy link
Author

kamnakis commented Feb 9, 2022

Duplicate fullcalendar/fullcalendar-vue#173

@kamnakis kamnakis closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant