Skip to content

Commit 555dcb0

Browse files
committed
add command to install latest shiki and fix vscode-textmate import problem
1 parent 532736a commit 555dcb0

File tree

1 file changed

+2
-4
lines changed
  • app/web_development/tutorials/next-js-static-first-mdx-starterkit/code-highlighting-plugin

1 file changed

+2
-4
lines changed

app/web_development/tutorials/next-js-static-first-mdx-starterkit/code-highlighting-plugin/page.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@ export const metadata = {
5252
For me, the best about **rehype pretty code** is that it uses [shiki](https://shiki.matsu.io/) under the hood, **shiki** is fantastic at highlighting code, but it also comes with an impressive feature, which is that you can use your favorite VSCode theme to make your code blocks look the same as your code in VSCode
5353

5454
> [!WARN]
55-
> If you use Typescript for your Next.js configuration file (next.config.ts) you need shiki >= 1.24.2
56-
>
57-
> If you import the rehype-pretty-code plugin in your next.config.ts, then you will get a node.js error telling you that it can NOT import the "vscode-textmate" package (which is a shiki dependency, shiki is used by this plugin):
55+
> If you use an older version of vscode-textmate and import the rehype-pretty-code plugin in your next.config.ts, then you will get a node.js error telling you that it can NOT import the "vscode-textmate" package (which is a shiki dependency, and shiki is a rehype-pretty-code dependency):
5856
>
5957
> ```shell
6058
> Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in @shikijs/vscode-textmate/package.json
6159
> ```
6260
>
63-
> The fix is to **update shiki to at least 1.24.3**, this will update vscode-textmate (fork by shikijs) to version 9.3.1, which contains the [vscode-textmate package.json fix (PR #2)](https://github.com/shikijs/vscode-textmate/pull/2)
61+
> The fix is to update vscode-textmate (the fork by shikijs) to at least version 9.3.1, as this is the first version containing the [vscode-textmate package.json fix (PR #2)](https://github.com/shikijs/vscode-textmate/pull/2), the easiest way is to just update shiki to the latest version using this command: `npm i shiki@latest`
6462
6563
## Adding a new playground page
6664

0 commit comments

Comments
 (0)