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
I have the following code block in a markdown file:
interfaceIdLabel{id: number,/* some fields */}interfaceNameLabel{name: string,/* other fields */}typeNameOrId<Textendsnumber|string>=Textendsnumber ? IdLabel : NameLabel;// This comment should not be included// ---cut---functioncreateLabel<Textendsnumber|string>(idOrName: T): NameOrId<T>{throw"unimplemented"}leta=createLabel("typescript");
Copied directly from the verify section in the remark-shiki-twoslash docs.
But when I try to build the project I get the following error.
Error: Transform failed with 1 error:
/src/pages/posts/index.md:34:3154: ERROR: Expected "}" but found "typescript"
at failureErrorWithLog (/node_modules/esbuild/lib/main.js:1605:15)
at /node_modules/esbuild/lib/main.js:1394:29
at /node_modules/esbuild/lib/main.js:668:9
at handleIncomingPacket (/node_modules/esbuild/lib/main.js:765:9)
at Socket.readFromStdout (/node_modules/esbuild/lib/main.js:635:7)
at Socket.emit (node:events:520:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
Now if I update the before code to be:
- let a = createLabel("typescript");+ let a = createLabel<string>("typescript");
Everything works exactly as expected and the code compiles correctly.
What I am trying to figure out is this remark-shiki-twoslash inheriting some TS settings from elsewhere in the project or is this Astro or esbuild interfering with remark-shiki-twoslash?
I also tried pasting the code from the docs into the playground to see if it worked as expected and it does, can be seen here. This would indicate to me that it is most likely something else interfering but I am struggling to figure out what.
The text was updated successfully, but these errors were encountered:
I have recently been trying to integrate
remark-shiki-twoslash
with Astro and I have been getting some weird errors.Reproduction repo here.
I have the following code block in a markdown file:
Copied directly from the verify section in the
remark-shiki-twoslash
docs.But when I try to build the project I get the following error.
Now if I update the before code to be:
Everything works exactly as expected and the code compiles correctly.
What I am trying to figure out is this
remark-shiki-twoslash
inheriting some TS settings from elsewhere in the project or is this Astro oresbuild
interfering withremark-shiki-twoslash
?I also tried pasting the code from the docs into the playground to see if it worked as expected and it does, can be seen here. This would indicate to me that it is most likely something else interfering but I am struggling to figure out what.
The text was updated successfully, but these errors were encountered: