In case it helps someone else, I was getting many errors running tsc with the hubspot nodejs library like:
node_modules/@hubspot/api-client/lib/codegen/cms/audit_logs/api/defaultApi.d.ts:13:8 - error TS1192: Module '"http"' has no default export.
13 import http from 'http';
and
./node_modules/@hubspot/api-client/lib/codegen/cms/audit_logs/model/models.d.ts:7:8 - error TS1259: Module '"/home/philc/node_projects/fut-skills/hubspot/node_modules/@types/request/index"' can only be default-imported using the 'esModuleInterop' flag
I was able to resolve this by modifying my tsconfig.json file to add the compiler option esModuleInterop so it looked like this:
I'm just posting a simple reply so I can mark this as solved.
The solution to esModuleInterop errors reported by tsc for the HubSpot API library files is to add "esModuleInterop": true to tsconfig.json under the "compilerOptions": block. See the original post for sample content.
Sorry to say that that workaround does not solve the problem for everyone. Library authors should not use esModuleInterop: true as you are forcing consumers of your package to change their tsconfig.
I'm just posting a simple reply so I can mark this as solved.
The solution to esModuleInterop errors reported by tsc for the HubSpot API library files is to add "esModuleInterop": true to tsconfig.json under the "compilerOptions": block. See the original post for sample content.