rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.
https://rehype-pretty.pages.dev
MIT License
1.01k stars 63 forks source link

`fs.readFileSync()` expects a string #148

Closed kaf-lamed-beyt closed 8 months ago

kaf-lamed-beyt commented 8 months ago

In this snippet from the homepage, when I tried using it as is for a custom theme on my blog, in getStaticProps, Next.js throws an error as shown in this issue title.

https://github.com/atomiks/rehype-pretty-code/blob/1c627dc05802ca4c4cce49150e6ce2f0d9fdc2c8/website/src/app/index.mdx#L243-L246

But, when I passed the file path as a string to my custom theme, the error was gone. Maybe this needs revision? If yes, I'd love to make the necessary changes and send a PR.

atomiks commented 8 months ago

Hmm, possibly. Not sure why it required URL in esm, that was copied from somewhere 🤔

kaf-lamed-beyt commented 8 months ago

Oh! Okay then.

Should I submit a PR that addresses it?

atomiks commented 8 months ago

Sure