-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 When Importing Dash.js 5 into Our Project #4664
Comments
Note: We have a related pending PR that changes the build configuration, see #4659. In any case, your Typescript config uses
|
@dsilhavy Thank you for your quick feedback! We will proceed to test ecbbe7b and wait for the mentioned pending PR. |
We have a small TypeScript example which also uses |
@dsilhavy we tested "esModuleInterop": true, but it did not fix our issue. We will take a look at this project also . thank you |
Hello @dsilhavy, However, with dash.js 4, we used to import the MSS library in our project like this: Could you please assist us with this issue? |
I have merged #4659 please check if this solves your issue. Also make sure to use the right path, for instance the |
Hello @dsilhavy , import * as dashjs from 'dashjs/dist/legacy/umd/dash.all.min'; However, this approach does not work because dash.all.min is not exported. Using import * as dashjs from 'dashjs'; does work now , but it’s unclear which bundle of Dash.js is being imported in this case. Additionally, we are still experiencing issues with MSS streams that did not work with Dash.js 5 when we try to import the library using: Could you please help us resolve this? We’d appreciate also your guidance on how to properly configure MSS with Dash.js 5. |
@dsilhavy Specifically:
export type CapabilitiesFilter = (representation: Representation) => boolean; export interface ICapabilitiesFilter { This aligns with how it was implemented in Dash.js 4. For QualityChangeRenderedEvent and QualityChangeRequestedEvent, in Dash.js 5.0.0, you replaced newQuality and oldQuality with newRepresentation and oldRepresentation in the code. However, the type definitions still refer to newQuality and oldQuality. You should update the definitions to:
Could you confirm these changes or provide clarification? |
Thanks for reporting the issues
This will use
I don't have insights into your build system but I added an example here: https://github.com/Dash-Industry-Forum/dash.js/tree/development/samples/modules/typescript-smooth. The
Thanks, they should be fixed in #4671 |
@dsilhavy Thank your for your feedback , I will test your latest changes ,check the sample for MSS and get back to you to confirm if our issue is resolved. |
We encountered an issue when trying to import Dash.js 5 into our project for testing.
The dashjs folder is present in the node_modules directory of our project, and we import it as follows: import * as dashjs from 'dashjs';
With Dash.js 4.x, this works fine, but with Dash.js 5.0.0, it no longer works.
Could you please assist us?
We noticed that in the package.json of Dash.js 5.0.0 (compared to Dash.js 4.x), the following exports section was added:
"exports": {
".": {
"types": "./index.d.ts",
"import": "./dist/esm/dash.all.debug.esm.js",
"default": "./dist/esm/dash.all.debug.esm.js",
"browser": "./dist/dash.all.min.js",
"script": "./dist/dash.all.min.js"
}
},
If we understand correctly, the dash.all.debug.esm.js file was introduced for browsers that natively support ECMAScript modules. However, what about projects like ours that are used on both older and modern platforms?
For your information, we are using TypeScript in our project, and here are the relevant compilerOptions from our tsconfig.json:
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"moduleResolution": "node",
"target": "es2015",
"lib": ["es2015", "dom"],
"outDir": "lib",
"sourceMap": false,
"declaration": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"typeRoots": ["node_modules/@types"],
"types": ["resize-observer-browser", "jquery", "node"],
"skipLibCheck": true
}
Thank you
The text was updated successfully, but these errors were encountered: