I use prosemirror-utils package in project with typescript@5. When I set compiler options module:nodenext and moduleResolution:nodenext in tsconfig.json, build fails:
error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("prosemirror-utils")' call instead.
My guess is that typescript finds *.cjs scripts, expects *.d.cts and does not find them.
So, probably solution is to add *.d.cts for type declaration for commonjs environment