Currently I have the following folder layouts in node JS and installed express js
sdk-components
--- HlsLoader.js
node_modules
--- hls.js
--- src
--- index.html
--- index.js
--- dist
--- hls.js
--- other files
When I load index.html in localhost like this:
http://localhost:8000/src/index.html
It calls index.js which contains:
import { hlsLoaderType, makeHlsLoader } from '../sdk-components/HlsLoader.js';
The first line of HlsLoader.js contains:
import Hls from 'hls.js';
However when I run index.html I get this error in console:
TypeError: Module specifier, 'hls.js' does not start with "/", "./", or "../"
But when I modify the import to:
import Hls from '../node_modules/hls.js/dist/hls.js';
I get this error instead:
SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.
So my question is, how can I resolve this import issue for the hls.js file?
Thanks!