-
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
r.assert is not a function error on npm package #5218
Comments
All console.assert statements are stripped from hls.min.js. The minified build is the production build. If you are using "hls.js" then you are using the debug build with assert statements included. |
Duplicates #5143 |
@alexlives if you prefer to use hls.js and want others from experiencing the same issue, please submit a PR that removes the https://github.com/video-dev/hls.js/blob/master/webpack.config.js#L274 |
I don't think we need to compile out the asserts on all builds. It makes sense to only have it done for the production version. I think on our end we need to evaluate how we're consuming the npm package in our project. We seem to only grab the hls.js file and not the hls.min.js Thank you for the quick reply. |
On video-dev, @gkatsev pointed out that "hls.js" is the default package export. We could do better. The expectation was that either subsequent builds would strip these statements out or that runtimes would not null You shouldn't have to go to these lengths. This is the second report of this kind, so if there aren't any contributions addressing it shortly, I'll get something in before the next minor release. |
What do you want to do with Hls.js?
We're using the latest npm build for our React project. We're seeing the library throw an error when in production mode. It appears that references to assert are not being stripped out. We are now using the babel-plugin-transform-console plugin in our production build to remove assert. However, this feels like a workaround based on debugging the hls.js library.
Is it possible for the npm package installed to have console.assert removed so that the consuming client does not require any special plugin?
What have you tried so far?
hls.js 1.3.1
webpack 5
drop_console: true seems to have no effect
The text was updated successfully, but these errors were encountered: