You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using script setup with lang="ts" causes [plugin:vite:vue] [@vue/compiler-sfc] <script> and <script setup> must have the same language type. error. The error does not occur if lang="ts" is removed.
#575 is the same issue except a reproduction is included in this issue.
As stated by the error: <script> and <script setup> must have the same language type. We inject a <script> block by default to each md file. But since not everyone uses TS, it doesn't has lang set to ts.
As a workaround, add empty <script> block with lang="ts" to your md file:
Describe the bug
Using script setup with
lang="ts"
causes[plugin:vite:vue] [@vue/compiler-sfc] <script> and <script setup> must have the same language type.
error. The error does not occur iflang="ts"
is removed.#575 is the same issue except a reproduction is included in this issue.
Reproduction
Minimal reproduction available here: https://github.com/olivervorasai/vitepress-starter-ts-bug
npm install
npm run docs:dev
This reproduction was creating using the following documentation:
Expected behavior
Vitepress should render with or without
lang="ts"
.System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: