-
Hey! 👋 I have a simple Express server using // index.js
import { unified } from 'unified'
import shikiTwoslash from 'remark-shiki-twoslash'
import parseMarkdown from 'remark-parse'
import serializeMarkdown from 'remark-stringify'
import markdownToHtml from 'remark-rehype'
import markdownToHtmlAgain from 'rehype-raw'
import serializeHtml from 'rehype-stringify'
const result = await unified()
.use(parseMarkdown)
.use(serializeMarkdown)
.use([
[shikiTwoslash, { theme: 'dark-plus' }]
// ...
])
.use(markdownToHtml, { allowDangerousHtml: true })
.use(markdownToHtmlAgain)
.use(serializeHtml)
.process('```js \n console.log("Hello, World!") \n ```') When I use remark-shiki-twoslash I encounter
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Most likely you're running into some quirkiness around A few things worth trying - import shikiTwoslash from 'remark-shiki-twoslash'
+ import * as shikiTwoslash from 'remark-shiki-twoslash' or - import shikiTwoslash from 'remark-shiki-twoslash'
+ import shikiTwoslash from 'remark-shiki-twoslash/dist/remark-shiki-twoslash.esm.js' it would also be worth checking if your TypeScript configuration matches the recommendations at https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm |
Beta Was this translation helpful? Give feedback.
-
Opened issue at shikijs/twoslash#147 if anyone encounters the same problem. |
Beta Was this translation helpful? Give feedback.
Opened issue at shikijs/twoslash#147 if anyone encounters the same problem.