sample-apps icon indicating copy to clipboard operation
sample-apps copied to clipboard

issue-direct-credential-express doesn't start correctly

Open jrogado opened this issue 2 years ago • 0 comments

When starting the issue-direct-credential-express app I get the following error (with node v20.11.0):

D:\Archive\Projects\mattr\direct-credentials\node_modules\ts-node\dist\index.js:851
return old(m, filename);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\Archive\Projects\mattr\direct-credentials\node_modules\got\dist\source\index.js from D:\Archive\Projects\mattr\direct-credentials\src\app.ts not supported.
Instead change the require of index.js in D:\Archive\Projects\mattr\direct-credentials\src\app.ts to a dynamic import() which is available in all CommonJS modules.
at require.extensions. [as .js] (D:\Archive\Projects\mattr\direct-credentials\node_modules\ts-node\dist\index.js:851:20)
at Object. (D:\Archive\Projects\mattr\direct-credentials\src\app.ts:50:31)
at m._compile (D:\Archive\Projects\mattr\direct-credentials\node_modules\ts-node\dist\index.js:857:29) {
code: 'ERR_REQUIRE_ESM' }

The issue is signaled in the "ts-node" index.js file, but is related to some other problem in the "got" library. It also refers to a require in an inde.js file which is probably the transpiled result of a typescript file, or a mismatch in the libary versions.

I cannot trace the correct origin of the problem, and cannot run the example. Any help is welcome.

jrogado avatar Apr 17 '24 22:04 jrogado