-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing "./src/is-supported" specifier in "hls.js" package. (svelte, vite) #5593
Comments
Having the same issue :) |
The src directory is not part of the distributed package files. |
That doesn't work
I believe what you mean is this:
|
Correct, 1.4 defines "hls.js" as an ESM module with a default export of the Hls class. |
We're also stuck on #5685 for the similar reasons. Users are trying to perform imports on src modules not exported by the project. The project only exports Hls by default for JavaScript and all the types exposed by the API for TypeScript. |
I argue that |
That would be a breaking change for users that call We could consider a feature request to remove static methods and provide named exports in v2. That could work for users pulling in the ESM build, but might require changes for folks pulling in the es5 UMD build. |
not necessarily,
|
That's what we wanted to do in #5685, but can not because Hls is the default export.
|
With #5930 we export all enums and classes on the public API. If you'd like static functions on the API (Hls) to be exported independently of the API, please open an PR that adds the named export. |
What version of Hls.js are you using?
v1.4.6
What browser (including version) are you using?
chrome 111
What OS (including version) are you using?
windows 11
Test stream
No response
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
https://stackblitz.com/edit/vitejs-vite-stkzfz?file=src%2FApp.svelte
Expected behaviour
should not error
What actually happened?
Hello, since version 1.4.0 importing
isSupported
fromhls.js/src/is-supported
throws an error from vite.use case:
isSupported
function is bundled with my app andhls.js
is dynamically imported if media source is supported, so to not increase my app bundle size if hls.js is not needed.Thanks.
Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: