Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Next.js 15: Getting error from esbuild with shiki langAlias config #598

Open
Assignees
@bismitpanda

Description

Whenever I add langALias to the @shikijs/rehype plugin, the build for the .mdx file containing a code block with the aliased language fails.

const blogs = defineCollection({
 name: "blogs",
 directory: "content",
 include: "blogs/*.mdx",
 schema: blogSchema,
 transform: async (_data, context) => {
 // Other ops
 const html = await compileMDX(context, data, {
 remarkPlugins: [
 remarkMath,
 remarkGemoji,
 [remarkGfm, { singleTilde: false }],
 ],
 rehypePlugins: [
 rehypeSlug,
 [rehypeAutolinkHeadings, { behavior: "wrap" }],
 rehypeKatex,
 [
 rehypeShiki,
 {
 theme: "material-theme-darker",
 transformers: [
 transformerNotationDiff(),
 transformerNotationHighlight(),
 transformerNotationFocus(),
 transformerNotationErrorLevel(),
 {
 pre(hast) {
 hast.properties["data-meta"] = this.options.meta?.__raw;
 hast.properties["data-code"] = this.source;
 hast.properties["data-language"] = this.options.lang;
 },
 code(hast) {
 hast.properties["data-line-numbers-max-digits"] =
 this.lines.length.toString().length;
 },
 } satisfies ShikiTransformer,
 ],
 inline: "tailing-curly-colon",
 langAlias: {
 "file-tree": "plain", // this fails if used
 },
 },
 ],
 ],
 });
 return {
 ...data,
 html,
 };
 },
});
## A file tree example
```file-tree
\```

Image

I have 2 mdx files, but the one where file-tree lang is used, fails

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /