Skip to content

Commit

Permalink
fix Could not parse expression with acorn for inline math code in `…
Browse files Browse the repository at this point in the history
…development` mode without turbopack enabled (#4167)

upd
  • Loading branch information
dimaMachina authored Feb 6, 2025
1 parent bbc760b commit b46d831
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/flat-rabbits-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"nextra": patch
---

fix `Could not parse expression with acorn` for inline math code in `development` mode without turbopack enabled

4 changes: 3 additions & 1 deletion packages/nextra/src/server/compile-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createProcessor } from '@mdx-js/mdx'
import type { Program } from 'estree'
import remarkFrontmatter from 'remark-frontmatter'
import remarkMath from 'remark-math'
import type { Plugin, Transformer } from 'unified'
import {
remarkAssignFrontMatter,
Expand Down Expand Up @@ -28,7 +29,8 @@ export async function compileMetadata(
remarkMdxFrontMatter,
remarkMdxTitle,
[remarkAssignFrontMatter, { lastCommitTime }],
remarkExportOnlyMetadata
remarkExportOnlyMetadata,
remarkMath // https://github.com/shuding/nextra/issues/4164
],
recmaPlugins: [recmaExportOnlyMetadata]
})
Expand Down

0 comments on commit b46d831

Please sign in to comment.