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

Issue with dash.js 5.0 (nightly version) #4619

Open
testeur-990 opened this issue Nov 7, 2024 · 6 comments
Open

Issue with dash.js 5.0 (nightly version) #4619

testeur-990 opened this issue Nov 7, 2024 · 6 comments
Assignees
Labels
Milestone

Comments

@testeur-990
Copy link

Hello,
We tried testing dash.js 5.0 (nightly version) on some older browser versions (e.g., Chrome 54), but we encountered errors related to modern JavaScript syntax. Could you please let us know if there were changes between dash.js 4.x and 5.x related to Babel or similar? because this kind of error did not occur with dash.js 4.x.

Please see below an example of the errors we encountered :
Uncaught SyntaxError: Unexpected token ? CMCDParameters.js

in this function
init(data) {
super.init(data);
if (data) {
this.version = data.version;
this.sessionID = data.sessionID;
this.contentID = data.contentID;
this.mode = data.mode ?? 'query';
this.keys = data.keys ? data.keys.split(' ') : null;
this.includeInRequests = data.includeInRequests ? data.includeInRequests.split(' ') : ['segment'];
this.schemeIdUri = data.schemeIdUri;
}
}
}

@testeur-990 testeur-990 added the Bug label Nov 7, 2024
@davemevans
Copy link
Contributor

Active discussion on this at #4617

@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 7, 2024

Thanks for linking the discussion @davemevans and thanks for testing @testeur-990.

I addressed this for now in #4620 . Please let me know if your issue is solved once the PR is merged.

@dsilhavy dsilhavy added this to the 5.0.0 milestone Nov 7, 2024
@dsilhavy dsilhavy self-assigned this Nov 7, 2024
@testeur-990
Copy link
Author

Thank you @dsilhavy ,with your change, we no longer have this error, but we're still unable to test dashjs 5 because another error occurs:

Uncaught TypeError: Object.values is not a function in the following function

function updateRules() {
let qualitySwitchRulesList = Object.values(constants_Constants_jsWEBPACK_IMPORTED_MODULE_12
["default"].QUALITY_SWITCH_RULES);
qualitySwitchRulesList.forEach(ruleName => {
qualitySwitchRules = handleRuleUpdate(ruleName, qualitySwitchRules);
});
let abandonFragmentRulesList = Object.values(_constants_Constants_js__WEBPACK_IMPORTED_MODULE_12
_["default"].ABANDON_FRAGMENT_RULES);
abandonFragmentRulesList.forEach(ruleName => {
abandonFragmentRules = _handleRuleUpdate(ruleName, abandonFragmentRules);
});

@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 7, 2024

@testeur-990 Thanks for checking. When transpiling for a certain Chrome version, the missing methods like Object.values are apparently not polyfilled. This can be done by adding useBuiltIns and corejs properties to the configuration, which did not work for me out of the box.

Since I want to encourage people to test v5 as easily as possible, I decided to completely transpile to ES5 for now and remove the target property. However, I will revisit this configuration before the release as it increases the bundle size.

Discussion is still ongoing in #4617 as well

@dsilhavy
Copy link
Collaborator

dsilhavy commented Nov 7, 2024

The corresponding PR for now is #4621

@testeur-990
Copy link
Author

testeur-990 commented Nov 12, 2024

Hello @dsilhavy ,
We tested the latest change as you mentioned, but we still have the same error related to Object.values
Uncaught TypeError: Object.values is not a function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants