TooTallNate / node-proxy-agent

Maps proxy protocols to `http.Agent` implementations
285 stars 69 forks source link

Compiling error after upgrading the proxy-agent version #60

Closed starchx closed 3 years ago

starchx commented 3 years ago

Hi Team, after upgrading:

"proxy-agent": "~3.1.1",

to

"proxy-agent": "~4.0.1",

Getting error:

../common/temp/node_modules/agent-base/dist/src/index.d.ts(2,8): error TS1192: Module '"net"' has no default export.
../common/temp/node_modules/agent-base/dist/src/index.d.ts(3,8): error TS1192: Module '"http"' has no default export.
../common/temp/node_modules/agent-base/dist/src/index.d.ts(4,8): error TS1192: Module '"https"' has no default export.

Is this because those modules are actually missing or because my TS config settings?

# tsconfig.json
{
  "compilerOptions": {
    "target": "es2018",
    "module": "commonjs",
    "outDir": "dist/",
    "lib": [
      "es6",
      "es2018"
    ],
    "strict": true,
    "moduleResolution": "node",
    "esModuleInterop": false,
    "resolveJsonModule": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "noImplicitAny": false,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "incremental": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": false,
    "inlineSourceMap": true,
    "inlineSources": true,
    "experimentalDecorators": true,
    "strictPropertyInitialization": false,
    "typeRoots": [
      "./node_modules/@types"
    ],
    "types": ["jest", "node"]
  },
  "exclude": [
    "node_modules",
    "dist",
    "src/ui",
  ]
}
TooTallNate commented 3 years ago

You need "esModuleInterop": true. Patches welcome to make the import statements compatible when this option is disabled.