Subscribe on changes!

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

avatar
Aug 20th 2021

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