Skip to content

Commit

Permalink
fix: make remarkCodeHike work in nextjs edge runtime by changing dyna…
Browse files Browse the repository at this point in the history
…mic import to require
  • Loading branch information
micooz committed Dec 8, 2024
1 parent 7e7b78d commit 8a38d8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/codehike/src/mdx/0.import-code-from-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ async function readFile(
let fs, path

try {
fs = (await import("fs")).default
path = (await import("path")).default
fs = require("fs")
path = require("path")
if (!fs || !fs.readFileSync || !path || !path.resolve) {
throw new Error("fs or path not found")
}
Expand Down

0 comments on commit 8a38d8e

Please sign in to comment.