Skip to content

[compiler-sfc][typescript]normal <script> below <script setup> report error while use typescript #4395

@klwfwdk

Description

@klwfwdk

Version

3.2.4

Reproduction link

sfc-playground

Steps to reproduce

  1. first <script setup> then <script> works
  2. first <script lang="ts> then <script setup lang="ts"> works
  3. first <script setup lang="ts"> then <script lang="ts"> broken with error Cannot access '__default__' before initialization

What is expected?

works well without consider order

What is actually happening?

use lang="ts" and put the normal block below setup block has error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions