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

Minified ESM from dash.all.min.esm.js not importable #4563

Closed
dsilhavy opened this issue Sep 5, 2024 · 2 comments · Fixed by #4565
Closed

Minified ESM from dash.all.min.esm.js not importable #4563

dsilhavy opened this issue Sep 5, 2024 · 2 comments · Fixed by #4565
Assignees
Labels
Milestone

Comments

@dsilhavy
Copy link
Collaborator

dsilhavy commented Sep 5, 2024

Description

We are creating ESM bundles including a dash.all.debug.esm.js and dash.all.min.esm.js. When testing the bundles and trying to import the dependencies the dash.all.debug.esm.js was working fine while dash.all.min.esm.js is not working. It looks like the modules are not correctly exported in dash.all.min.esm.js.

@dsilhavy dsilhavy added the Bug label Sep 5, 2024
@dsilhavy dsilhavy added this to the 5.0.0 milestone Sep 5, 2024
@dsilhavy dsilhavy self-assigned this Sep 5, 2024
@dsilhavy
Copy link
Collaborator Author

dsilhavy commented Sep 5, 2024

Feedback by @littlespex on Slack:

I can see why its not working. Look at the last line of the minified file:

[5:03](https://dashif.slack.com/archives/D07KV3PUR6X/p1725548599604459)
p=dashjs,h=(r=r.default).false,y=r.false,b=r.false,v=r.false,E=r.false,_=r.false,T=r.default,A=r.false;export{h as Constants,y as Debug,b as MediaPlayer,v as MediaPlayerFactory,E as MetricsReporting,_ as Protection,T as default,A as supportsMediaSource};

All of the .false variables are undefined. I tried many different Webpack settings and so far nothing fixes it.

@littlespex
Copy link
Contributor

littlespex commented Sep 5, 2024

It looks like the .false naming is intentional and a feature of webpack's optimization step. Setting optimization.usedExports to false seems to fix the issue.

@github-project-automation github-project-automation bot moved this from Selected for Development to Done in dash.js Version 5.0.0 Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants