Because of security issue with node-fetch I needed to update ky-universal to 0.10.0 (issue)
Once I did this, I got the following error:
C:\Users\me\git\my_code\node_modules\@digitalbazaar\http-client\main.js:1
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\me\git\my_code\node_modules\ky-universal\index.js from C:\Users\me\git\my_code\node_modules\@digitalbazaar\http-client\main.js not supported.
Instead change the require of index.js in C:\Users\me\git\my_code\node_modules\@digitalbazaar\http-client\main.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (C:\Users\me\git\my_code\node_modules\@digitalbazaar\http-client\main.js:1)
at Generator.next (<anonymous>)
at Object.<anonymous> (node_modules/@digitalbazaar/http-client/index.js:8:18)
at Object.<anonymous> (node_modules/jsonld/lib/documentLoaders/node.js:12:22)
at Object.<anonymous> (node_modules/jsonld/lib/platform.js:6:20)
at Object.<anonymous> (node_modules/jsonld/lib/jsonld.js:37:18)
at Object.<anonymous> (node_modules/jsonld/lib/index.js:8:18)
at Object.<anonymous> (utils/my_code_where_I_require_jsonld.js:1513:26)
Because of security issue with
node-fetch
I needed to updateky-universal
to0.10.0
(issue)Once I did this, I got the following error:
My
package.json
(relevant parts only):In my code, I do:
Tried with node 14 & 16
I've created https://github.com/digitalbazaar/http-client/issues/17 but after some investigation it looks like it is more relevant here, since
http-client
usesimport
andrequire
is used here: https://github.com/digitalbazaar/jsonld.js/blob/20e2286d198ce7d376320306f9df3667f48a4544/lib/documentLoaders/node.js#L12