rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CJS build is broken, using a dependency that is ESM only - part 2

ooddaa opened this issue · comments

npm build fails because of:

Error [ERR_REQUIRE_ESM]: 
require() of ES Module ./node_modules/unist-util-visit/index.js 
from 
./node_modules/rehype-pretty-code/dist/rehype-pretty-code.cjs 
not supported.
Instead change the require of index.js in 
./node_modules/rehype-pretty-code/dist/rehype-pretty-code.cjs 
to a dynamic import() which is available in all CommonJS modules.

I'm using rehype-pretty-code v0.10.2

I saw a similar issue with unified package (June 20 this year), can this be also fixed please?

Thanks!

We've removed CJS support now and have made the package ESM-only.

Although it should've been published with a new minor v0.11.0 cc @o-az

We've removed CJS support now and have made the package ESM-only.

Ok I see. Could you tell me in which version that happened please? I'll rollback for the time being.

commented

@ooddaa Try v0.10.0

@ooddaa Try v0.10.0

Thanks, v0.10.1 solved it for me