OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Node JS "Importing binding name 'default' cannot be resolved by star export entries" for HLS.js

  • Thread starter Thread starter user2028856
  • Start date Start date
U

user2028856

Guest
Currently I have the following folder layouts in node JS and installed express js

Code:
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:

Code:
http://localhost:8000/src/index.html

It calls index.js which contains:

Code:
import { hlsLoaderType, makeHlsLoader } from '../sdk-components/HlsLoader.js';

The first line of HlsLoader.js contains:

Code:
import Hls from 'hls.js';

However when I run index.html I get this error in console:

Code:
TypeError: Module specifier, 'hls.js' does not start with "/", "./", or "../"

But when I modify the import to:

Code:
import Hls from '../node_modules/hls.js/dist/hls.js';

I get this error instead:

Code:
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!

<p>Currently I have the following folder layouts in node JS and installed express js</p>
<pre><code>sdk-components
--- HlsLoader.js

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

Latest posts

Top