Skip to content

Commit

Permalink
fix(mdx): #291 directory import error on next.js pages router
Browse files Browse the repository at this point in the history
Use full path to mdx-bundler client include index.js,
instead of only the directory.
This should fix the usage of mdx package in next.js pages router.
Add sample for next.js pages router

Closes: #277
  • Loading branch information
sdorra authored Sep 12, 2024
1 parent b3a10d7 commit fd7f11d
Show file tree
Hide file tree
Showing 22 changed files with 815 additions and 89 deletions.
2 changes: 1 addition & 1 deletion packages/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"esbuild": "^0.21.4",
"mdx-bundler": "^10.0.2",
"mdx-bundler": "^10.0.3",
"unified": "^11.0.5"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdx/src/react/client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MDXContentProps, getMDXComponent } from "mdx-bundler/client";
import { MDXContentProps, getMDXComponent } from "mdx-bundler/client/index.js";
import { useMemo } from "react";

export function useMDXComponent(
Expand Down
Loading

0 comments on commit fd7f11d

Please sign in to comment.