Skip to content
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

Hls.js does not work with SvelteKit (vite) #5156

Closed
5 tasks done
codercms opened this issue Jan 13, 2023 · 3 comments
Closed
5 tasks done

Hls.js does not work with SvelteKit (vite) #5156

codercms opened this issue Jan 13, 2023 · 3 comments
Labels

Comments

@codercms
Copy link

codercms commented Jan 13, 2023

What version of Hls.js are you using?

1.2.9

What browser (including version) are you using?

Firefox 108.0.2

What OS (including version) are you using?

Win 10

Test stream

No response

Configuration

{}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Install fresh version of SvelteKit
  2. Install hls.js (npm i hls.js --save-dev)
  3. Import hls.js into your component (import Hls from 'hls.js')
  4. Try to load and play video

Expected behaviour

hls.js should work

What actually happened?

hls.js failed with TypeError: __webpack_modules__2[moduleId] is undefined error

See reproduction in stackblitz - https://stackblitz.com/edit/vitejs-vite-jhuctn?file=src%2FApp.svelte

P.S. Related issue - #5146
hls.js works fine if import it like this: import Hls from "hls.js/dist/hls.min.js";

Console output

TypeError: __webpack_modules__2[moduleId] is undefined

Chrome media internals output

No response

@codercms codercms added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jan 13, 2023
@laurens94
Copy link

laurens94 commented Jan 19, 2023

It seems the combination of Vite v4 with hls.js causes this. Downgrading vite from 4.0.0 to 3.2.5 and @vitejs/plugin-vue from 4.0.0 to 3.2.0 'solved' this issue for me.

Perhaps it's related to the upgrade to Rollup v3 in the latest Vite version?

For me the issue only occured when running the code locally with vite dev server. Building with vite build and then running the output code didn't give any error.

@laurens94
Copy link

Ah I just stumbled upon this issue #5107 which should fix it.

@robwalch robwalch added this to the 1.5.0 milestone Feb 27, 2023
@robwalch robwalch removed the Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. label Feb 27, 2023
@jer-0
Copy link
Contributor

jer-0 commented Jun 23, 2023

@robwalch doesn't 1.4.0 fixes this?

@robwalch robwalch removed this from the 1.5.0 milestone Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants