dhiway / cord.js

Cord JS API
Apache License 2.0
69 stars 49 forks source link

fix the REQUIRE_ESM error in vc-export package #36

Closed amarts closed 1 year ago

amarts commented 1 year ago
app     | /app/node_modules/@cord.network/vc-export/lib/cjs/suites/documentLoader.js:5
app     | const vcjs = (0, tslib_1.__importStar)(require("@digitalbazaar/vc"));
app     |                                        ^
app     |
app     | Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/@digitalbazaar/vc/lib/index.js from /app/node_modules/@cord.network/vc-export/lib/cjs/suites/documentLoader.js not supported.
app     | Instead change the require of index.js in /app/node_modules/@cord.network/vc-export/lib/cjs/suites/documentLoader.js to a dynamic import() which is available in all CommonJS modules.

above issue used to come when we were using vc-export in any application. Fixed with this commit

Signed-off-by: Amar Tumballi amar@dhiway.com