You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing my script, it crashes with this error :
Error [ERR_REQUIRE_ESM]: require() of ES Module /media/sf_NPL/core/node_modules/serialize-error/index.js from /media/sf_NPL/core/imports/manager/imports/log.ts not supported.
Instead change the require of index.js in /media/sf_NPL/core/imports/manager/imports/log.ts to a dynamic import() which is available in all CommonJS modules.
at Object.require.extensions.<computed> [as .js] (/home/jer/.nvm/versions/node/v16.20.2/lib/node_modules/ts-node/dist/index.js:851:20)
at Object.<anonymous> (/media/sf_NPL/core/imports/manager/imports/log.ts:28:27)
at Module.m._compile (/home/jer/.nvm/versions/node/v16.20.2/lib/node_modules/ts-node/dist/index.js:857:29)
at Object.require.extensions.<computed> [as .ts] (/home/jer/.nvm/versions/node/v16.20.2/lib/node_modules/ts-node/dist/index.js:859:16)
at new Manager (/media/sf_NPL/core/imports/manager/index.ts:15:20)
at /media/sf_NPL/core/index.ts:80:19 {
code: 'ERR_REQUIRE_ESM'
}
I'm getting the same error if I use instead :
const serializeError = require('serialize-error')
I write Typescript code which is then executed with ts-node myscript.ts.
I'm using (as per the doc) :
import { serializeError } from 'serialize-error';
When executing my script, it crashes with this error :
I'm getting the same error if I use instead :
const serializeError = require('serialize-error')
I write Typescript code which is then executed with
ts-node myscript.ts
.Versions :
node 16.20.2
serialize-error ^11.0.1
ts-node 10.9.1
The text was updated successfully, but these errors were encountered: