-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
How to import Hls.js from another file #2911
Comments
It's a default export, so: |
From the error, on the Chrome console give the following message:
If I try:
Returns the error:
It is worth mentioning that I am importing a simple js file from a player I am developing |
There is no ES6 export in the JavaScript dist. It's a UMD module (amd, require, or global). See #2910 |
I used the following syntax and solved my problem: |
I also had to set tsconfig compiler option to "allowSyntheticDefaultImports": false in order for the default import to work. |
Hi |
What do you want to do with Hls.js?
I would like to import the hls.js file into another javascript file
What have you tried so far?
I tried importart like this:
import * as Hls from "./hls.js";
However, give the following error on the console:
And the console points to the highlighted line:
The text was updated successfully, but these errors were encountered: