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
/home/ec2-user/.nvm/versions/node/v14.17.4/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:1
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /srv/web/cc-bank/node_modules/@polkadot/keyring/pair/decode.js
require() of ES modules is not supported.
require() of /srv/web/cc-bank/node_modules/@polkadot/keyring/pair/decode.js from /srv/web/cc-bank/node_modules/@bitgo/sdk-coin-dot/dist/src/lib/utils.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename decode.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /srv/web/cc-bank/node_modules/@polkadot/keyring/package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1089:13)
at Object.Hook._require.Module.require (/home/ec2-user/.nvm/versions/node/v14.17.4/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39) {
code: 'ERR_REQUIRE_ESM'
}
The text was updated successfully, but these errors were encountered:
Environment Details
Expected Behavior
Current Behavior
Trying to run the application with ESM in all the abovementioned environments.
pm2 start index.js --node-args="-r esm" --name="bank" -f
Getting the following error:
/home/ec2-user/.nvm/versions/node/v14.17.4/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:1
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /srv/web/cc-bank/node_modules/@polkadot/keyring/pair/decode.js
require() of ES modules is not supported.
require() of /srv/web/cc-bank/node_modules/@polkadot/keyring/pair/decode.js from /srv/web/cc-bank/node_modules/@bitgo/sdk-coin-dot/dist/src/lib/utils.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename decode.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /srv/web/cc-bank/node_modules/@polkadot/keyring/package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1089:13)
at Object.Hook._require.Module.require (/home/ec2-user/.nvm/versions/node/v14.17.4/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39) {
code: 'ERR_REQUIRE_ESM'
}
The text was updated successfully, but these errors were encountered: