Skip to content

[TS] "Cannot find name" when using defineEmits+interface #607

Closed
@j4k0xb

Description

@j4k0xb

Using <script setup> and volar v0.28.6, this works fine:

<template>
  <p>{{ someVar }}</p>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
const someVar = ref(3);

const emit = defineEmits<{
  (e: 'change', id: number): void;
}>();
</script>

But when using an interface with defineEmits, no variables/functions/props/etc can be found by TS anymore:
image
And doing the same thing with defineProps works with no problems

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      [TS] "Cannot find name" when using defineEmits+interface · Issue #607 · vuejs/language-tools