andrewbranch / gatsby-remark-vscode

Gatsby plugin to provide VS Code’s syntax highlighting to Markdown code fences

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-Gatsby Remark Plugin in MDSveX

janosh opened this issue · comments

Thanks @codepunkt for #157! I just tried this out with MDSveX and got a pretty unhelpful Vite error message. My first guess is that it's an ESM-CJS compat issue. You mentioned you're also using the remark plugin in an ESM setting. Did you have to jump through any hoops to get it working?

Error: offset is longer than source length!
    at numberToPos (node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:4221:15)
    at formatError (node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:44580:24)
    at TransformContext.error (node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:44560:19)
    at Object.transform (node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:44768:25)
    at async transformRequest (node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:59029:29)
    at async instantiateModule (node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:68641:10)

Thanks for the link to your code. Will try to debug mine over the weekend maybe. Closing this for now as there's nothing actionable atm.