Skip to content

When the second script tag uses 'export default', it will result in a ts(2448) error #5776

@eric-gitta-moore

Description

@eric-gitta-moore

Vue - Official extension or vue-tsc version

latest

VSCode version

latest

Vue version

3.5.25

TypeScript version

5.9.3

System Info

in vueuse playground.

package.json dependencies

{}

Steps to reproduce

playground

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

defineProps<{ msg: string }>();

const count = ref(eee);
</script>

<script lang="ts">
export default {
  name: '1212'
}
export const eee = 1
</script>

<template>
  <div class="flex items-center justify-center w-screen h-screen">
    {{ count }}
  </div>
</template>

What is expected?

No longer display the ts(2448) error

What is actually happening?

Block-scoped variable 'eee' used before its declaration.ts(2448)
App.vue(13, 14): 'eee' is declared here.
Image

Link to minimal reproduction

https://playground.vueuse.org/?vueuse=13.9.0#eNp9UstOwzAQ/JWVLwUJUrXApQQkQBzgAAg4WkJRugkujm157RIU5d/ZOG15COGTvTOemV27ExfOZeuIYiFyKr1yAQhDdKALU59JEUiKc2lU46wP0IHHCnqovG1gwtcmp9JIs8RKGXzw1lHeQUP1Aih4ZWroz/f2E6W0hgKUNpoAZ4PKHiIOUD4dbdmED5sIP82xTebsUkTNIaQBMEWDC5jM5rP5RJp+Rxp9WJtdZr/VAzZOFwH5BJAv1RpKXRCxU6WxBcU4HZZoAnpYRQqq+tge3w9ZCNHA62aTkgGvrtu01XMKlp2yLkP59JubOOBeOFql6mxF1vC0UxdSlLZxSqO/d0FxdCkWY38DVmht329TLfiIB9t6+Yrl2x/1FbVDTYoHj4R+jVLssFD4GsMIXz/dYcv7HdjYZdTM/gd8RLI6DhlH2mU0S479jZfS3qR/wi//TNdtQEPbpoagA7NPfCn471z90/pX3KPsON3jR+YpvqzRD5o8wKPsJJufiP4TNWTtWQ==

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions