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
In the *.md files to process, we can include <script setup> blocks. They are processed all right.
However, when switching to <script setup lang="ts">, npm run dev will still work, however, npm build will fail with an error resembling this:
error during build:
Error: [vite:esbuild] Transform failed with 1 error:
${path_to}/SomeText.md?vue&type=script&setup=true&lang.ts:1:15: ERROR: Exp
file: ${path_to}/SomeText.md?vue&type=script&setup=true&lang.ts:1:15
Expected ">" but found "class"
1 | <template><div class="markdown-body"><p>import { defineComponent as _defineComponent } from ‘vue’
| ^
2 | import { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as
3 | <p>const _hoisted_1 = { class: “markdown-body” }
at failureErrorWithLog (${project_path}\node_modules\esbuild\lib\main.js:1651:15)
at ${project_path}\node_modules\esbuild\lib\main.js:849:29
at responseCallbacks.<computed> (${project_path}\node_modules\esbuild\lib\main.js:704:9)
at handleIncomingPacket (${project_path}\node_modules\esbuild\lib\main.js:764:9)
at Socket.readFromStdout (${project_path}\node_modules\esbuild\lib\main.js:680:7)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
ERROR: "build-only" exited with 1.
Reproduction
Both with implicit and with explicit Javascript definition, the example works:
ImplicitJavaScriptExample.md:
<scriptsetup>
</script>
# Header
Paragraph with some text
ExplicitJavaScriptExample.md:
<scriptsetuplang="js">
</script>
# Header
Paragraph with some text
TypeScriptExample.md:
With TypeScript, it does not work:
<scriptsetuplang="ts">
</script>
# Header
Paragraph with some text
Describe the bug
In the
*.md
files to process, we can include<script setup>
blocks. They are processed all right.However, when switching to
<script setup lang="ts">
,npm run dev
will still work, however,npm build
will fail with an error resembling this:Reproduction
Both with implicit and with explicit Javascript definition, the example works:
ImplicitJavaScriptExample.md
:ExplicitJavaScriptExample.md
:TypeScriptExample.md
:With TypeScript, it does not work:
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: