Here is the error message without esmoduleInterop:
node_modules/get-uri/dist/http.d.ts:5:8 - error TS1192: Module '"http"' has no default export.
5 import http_ from 'http';
~~~~~
node_modules/get-uri/dist/http.d.ts:6:8 - error TS1192: Module '"https"' has no default export.
6 import https from 'https';
~~~~~
node_modules/proxy-agent/dist/index.d.ts:3:8 - error TS1259: Module '"/Users/sean/Documents/ionic/ionic-cli/packages/@ionic/cli/node_modules/proxy-agent/node_modules/lru-cache/index"' can only be default-imported using the 'esModuleInterop' flag
3 import LRUCache from 'lru-cache';
~~~~~~~~
node_modules/proxy-agent/node_modules/lru-cache/index.d.ts:869:1
869 export = LRUCache
~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
Found 3 errors in 2 files.
Errors Files
2 node_modules/get-uri/dist/http.d.ts:5
1 node_modules/proxy-agent/dist/index.d.ts:3
Ionic CLI currently reports a security vulnerability with the
vm2
dependency as a result ofsuperagent-proxy
→proxy-agent
.The
superagent-proxy
package is a smaller wrapper aroundsuperagent
andproxy-agent
that is not maintained.This PR removes the dependency for
superagent-proxy
and upgrades toproxy-agent@6
which no longer has thevm2
dependency requirement. Theproxy-agent
package uses ESM & as a result a lot of other usages had to be migrated onceesmoduleInterop
was enabled. The proxy behavior thatsuperagent-proxy
was responsible for has been added here: https://github.com/ionic-team/ionic-cli/blob/4332a24af67b98424ff19083a6f9e2e09a66c0a8/packages/%40ionic/cli/src/lib/utils/superagent-proxy.tsHere is the error message without
esmoduleInterop
: