Electron ES6 module import : <p>Electron   3.0.0-beta.1
Node       10.2.0
Chromium   66.0.3359.181</p>

<p>The problem I'm having is importing a module.  I created the following protocol:</p>

<pre><code>protocol.registerFileProtocol('client', (request, callback) =&gt; {
    var url = request.url.substr(8);
    callback({path: path.join(__dirname, url)});
});
</code></pre>

<p>The output of the protocol is the correct path</p>

<pre><code>"/Users/adviner/Projects/Client/src/ClientsApp/app.js"
</code></pre>

<p>I have the following module app.js with the following code:</p>

<pre><code>export function square() {
    return 'hello';
}
</code></pre>

<p>in my index.html I import the module like so:</p>

<pre><code>    &lt;script type="module" &gt;
        import square from 'client://app.js';
        console.log(square());
    &lt;/script&gt;       
</code></pre>

<p>But I keep getting the error:</p>

<p>app.js/:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.</p>

<p>I'm done searches but can't seem to find a solution.  Can anyone suggest a way I can make this work?</p>

<p>Thanks</p>
