amazon-chime-sdk-js
amazon-chime-sdk-js copied to clipboard
SDK Does not Pass the Typechecker
What happened and what did you expect to happen?
The file node_modules/amazon-chime-sdk-js/build/signalingprotocol/SignalingProtocol.d.ts does not pass typescript typechecker. I have elided the output but there are 22 instances of this same error:
node_modules/amazon-chime-sdk-js/build/signalingprotocol/SignalingProtocol.d.ts:7:26 - error TS2709: Cannot use namespace 'Long' as a type.
7 timestampMs: (number|Long);
~~~~
node_modules/amazon-chime-sdk-js/build/signalingprotocol/SignalingProtocol.d.ts:89:33 - error TS2709: Cannot use namespace 'Long' as a type.
89 public timestampMs: (number|Long);
~~~~
Versions:
yarn why -R long
└─ amazon-chime-sdk-js@npm:3.20.0 (via npm:^3.20.0)
└─ protobufjs@npm:7.2.6 (via npm:^7.2.4)
└─ long@npm:5.2.3 (via npm:^5.0.0)
yarn info typescript
└─ typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7
├─ Version: 5.3.3
skipLibCheck is false in my project
I did a manual patch of SignalingProtocol.d.ts to change and it seems to compile
-import Long = require("long");
+import type Long from "long";
Have you reviewed our existing documentation?
Reproduction steps
yarn run tsc as a downstream project that checks libs with "skipLibCheck": false in one's tsconfig.json
Amazon Chime SDK for JavaScript version
posted above
What browsers are you seeing the problem on?
n/a
Browser version
n/a
Meeting and Attendee ID Information.
No response
Browser console logs
n/a
What typescript version are you using?
As specificed in the original issue, this was produced in typescript version 5.3.3, though it still appears to be the case in 5.4.x.
I have made a minmalist reproduction with a replit here: https://replit.com/@dairyisscary/Aws-sdk-reproduction?v=1#tsconfig.json
i think that some combination of the tsconfig.json configuration options module, moduleResolution and of course, skipLibCheck: false are what make the semantics of this particular line import Long = require("long"); invalid here. 🤷