CJS build is broken, using a dependency that is ESM only - part 2
ooddaa opened this issue · comments
oda nabunaga commented
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!
atomiks commented
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
oda nabunaga commented
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.
oda nabunaga commented
@ooddaa Try v0.10.0
Thanks, v0.10.1 solved it for me