My folder layout in Node.js (I installed Express.js):
sdk-components
--- HlsLoader.js
node_modules
--- hls.js
--- src
--- index.html
--- index.js
--- dist
--- hls.js
--- other files
When I load 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:
import Hls from 'hls.js';
However when I run index.html I get:
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:
SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.
How can I resolve this import issue with the hls.js file?