amazon-ivs-player-web-sample
amazon-ivs-player-web-sample copied to clipboard
Failing typescript type checks
Describe the bug
I'm setting up the amazon-ivs-player
in a new project, importing the library via NPM using the instructions here, and using typescript to compile my code.
amazon-ivs-player
is causing failures on typescript compilation because of the following type errors:
node_modules/amazon-ivs-player/dist/index.d.ts:1:33 - error TS2307: Cannot find module 'types/autoplay-options' or its corresponding type declarations.
1 import { AutoPlayOptions } from 'types/autoplay-options';
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/amazon-ivs-player/dist/index.d.ts:783:5 - error TS1169: A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.
783 [PlayerEventType.STATE_CHANGED]: PlayerState;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/amazon-ivs-player/dist/index.d.ts:783:22 - error TS2339: Property 'STATE_CHANGED' does not exist on type 'typeof PlayerEventType'.
783 [PlayerEventType.STATE_CHANGED]: PlayerState;
~~~~~~~~~~~~~
Found 3 errors in the same file, starting at: node_modules/amazon-ivs-player/dist/index.d.ts:1
To Reproduce
- Clone the sample repo at https://github.com/mikesea/ivs-tsc-test and run
npx lint
in the repo to see the failing checks
Expected behavior Library does not fail typescript compiler.
Hey @mikesea, thanks for the report. We're aware of this bug and it will be fixed in the next release
Are you able to work around this issue?
@johnBartos nice, thanks! Any idea when a release might be coming? 😉
Are you able to work around this issue?
I can use the skipLibCheck
option with the compiler, but that's not ideal. Thanks for your quick response!
Happy to help! We plan to release the next version later next month.