-
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
v1.2.5 throws an error in a next.js production build #5015
Comments
Other notes:
If this is as issue for the next.js team, please let me know and close this issue. Thanks! 👍 |
Probably a result of upgrading to Webpack 5 (webworkify-webpack) #5007. Looks like you re-bundling hls.js? Can you provide a sample page that isolates/reproduces the issue? @iscekic I am not familiar with next.js setup so the steps to reproduce set a pretty high bar. If provided a page that reproduces the issue, I can debug through how the worker JS is composed here, and may be able to come up with a fix. Workarounds for v1.2.5: disable worker |
Here's a minimal reproduction repo (default nextjs config): https://github.com/iscekic/hlsjs-repro
It does look like some sort of transformation is happening. I'll look into whether it's possible to selectively disable it for a package. |
Looks like this is an issue with the |
Hi @iscekic,
Thanks for looking in to it and finding a workaround for v1.2.7. #5036 fixes the issue with your sample app. The code that extracts required module js from runtime exports and injects it into a worker did not expect for the modules to have named functions with quotes ( |
Thank you @robwalch 🙏 |
The new Next.js 13.0.5 version is supposed to fix this, but it seems it does not, the Also reported over here: vercel/next.js#42852 (comment) |
It seems that @kdy1 made an issue in the SWC repo to track this: swc-project/swc#6504 |
This is tracked at swc-project/swc#6504 |
Oh 🤣 |
I'll fix this within next week |
New PR in Next.js to update to fixed SWC version (SWC fixed in swc-project/swc#6504): |
Looks like the SWC update change was merged to the Next.js Released in |
Sorry, was there a fix there that now allows HLS.js to work with nextjs without error? @karlhorky
|
That error seems unrelated to the others in this issue. Latest @iDVB maybe search for related issues or open a new issue with a reproduction on StackBlitz or CodeSandbox? |
Hello! Version 1.4 is in beta now. We've switched from webpack to rollup for packaging. There are also a few changes to prevent throwing in Node/next.js environments. Please give it a try an provide feedback. If you are still running into issues with this release let us know and consider providing a sample we can use to reproduce the issue: https://github.com/video-dev/hls.js/releases/tag/v1.4.0-beta.2 Thanks 👋 |
What version of Hls.js are you using?
v1.2.5
What browser (including version) are you using?
Chrome Version 107.0.5304.87 (Official Build) (x86_64)
What OS (including version) are you using?
MacOS Ventura 13.0
Test stream
/
Configuration
Additional player setup steps
/
Checklist
Steps to reproduce
hls.js
as a dependencyhls.js
(https://nextjs.org/docs/advanced-features/dynamic-import)Expected behaviour
Stream plays
What actually happened?
Stream does not play
Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: