Skip to content

Commit b46d831

Browse files
authoredFeb 6, 2025··
fix Could not parse expression with acorn for inline math code in development mode without turbopack enabled (#4167)
upd
1 parent bbc760b commit b46d831

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎.changeset/flat-rabbits-accept.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"nextra": patch
3+
---
4+
5+
fix `Could not parse expression with acorn` for inline math code in `development` mode without turbopack enabled
6+

‎packages/nextra/src/server/compile-metadata.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createProcessor } from '@mdx-js/mdx'
22
import type { Program } from 'estree'
33
import remarkFrontmatter from 'remark-frontmatter'
4+
import remarkMath from 'remark-math'
45
import type { Plugin, Transformer } from 'unified'
56
import {
67
remarkAssignFrontMatter,
@@ -28,7 +29,8 @@ export async function compileMetadata(
2829
remarkMdxFrontMatter,
2930
remarkMdxTitle,
3031
[remarkAssignFrontMatter, { lastCommitTime }],
31-
remarkExportOnlyMetadata
32+
remarkExportOnlyMetadata,
33+
remarkMath // https://github.com/shuding/nextra/issues/4164
3234
],
3335
recmaPlugins: [recmaExportOnlyMetadata]
3436
})

0 commit comments

Comments
 (0)
Please sign in to comment.