shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.06k stars 51 forks source link

Does this still work with next.js? #191

Open tonyxiao opened 9 months ago

tonyxiao commented 9 months ago

Seems that the example has been removed. Is next.js / nextra still supported?

https://github.com/shikijs/twoslash/commit/4f963b1e8be7cb3d552c271e7dc996a29f4735b7

orta commented 9 months ago

I think people are using it with next, I just haven't used next myself and couldn't really say

zhangyu1818 commented 7 months ago

I integrated shikijs with next app router without any issues. When I added twoslash it couldn't run.

Add @shikijs/twoslash to serverComponentsExternalPackages to solve the error.

const nextConfig = {
  experimental: {
    serverComponentsExternalPackages: [
      "@shikijs/twoslash",
    ],
  },
};