Closed TimoGlastra closed 1 month ago
Latest commit: 4efd105ea8ffab436abaafe43bfc56cc7d2b79bd
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
We have been having an Mdoc error running our Credo Backchannel/Agent in the Interop Tests in OATH. Will this fix solve this problem or is this a new issue?
[31m/src/node_modules/@credo-ts/core/build/modules/mdoc/Mdoc.js:4
const mdoc_client_1 = require("@protokoll/mdoc-client");
^[39m
[31mError [ERR_REQUIRE_ESM]: require() of ES Module /src/node_modules/@protokoll/mdoc-client/dist/cjs/src/index.js from /src/node_modules/@credo-ts/core/build/modules/mdoc/Mdoc.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /src/node_modules/@protokoll/mdoc-client/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at Object.<anonymous> [90m(/src/[39mnode_modules/[4m@credo-ts[24m/core/build/modules/mdoc/Mdoc.js:4:23[90m)[39m {
code: [32m'ERR_REQUIRE_ESM'[39m
}[39m
No, but it's weird that you get that error as the library it's complaining about is not a module.
Probably something related to ts-node 🤔
Two fixes for mdoc: