You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
Im trying to use the hls.js/light in my project but looks like the typescript types don't work correctly for it.
Typescript shows error for it
Could not find a declaration file for module 'hls.js/light'. '/Users/user/Projects/project/node_modules/hls.js/dist/hls.light.mjs' implicitly has an 'any' type.
Try `npm i --save-dev @types/hls.js` if it exists or add a new declaration (.d.ts) file containing `declare module 'hls.js/light';` (ts 7016)
I can see that same issue happens with just an empty react project ex. npm create vite@latest and importing import Hls from 'hls.js/light';.
I checked a bit the hls.js package.json about the exported types but looks like there is nothing defined for the light version.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
Im trying to use the
hls.js/light
in my project but looks like the typescript types don't work correctly for it.Typescript shows error for it
I can see that same issue happens with just an empty react project ex.
npm create vite@latest
and importingimport Hls from 'hls.js/light';
.I checked a bit the hls.js package.json about the exported types but looks like there is nothing defined for the
light
version.Ive tried to add
"types": "./dist/hls.d.ts"
as a test, inside thelight
object from above and that makes TS happy, but not a solution.Does anybody knows how to assign the correct types for this case?
Also if there is any documentation about the
light
mode i can checkBeta Was this translation helpful? Give feedback.
All reactions