Module Import Error

Hi. I’m creating and importing a module in my code. The module is:

var a=5
export {a}

The HTML code to import it is:

<script type="module">
    import a from '/test_mod.jms'

When I run the HTML file, I get the error:

Failed to load module script: The server responded with a non-JavaScript MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.

It seems the file is the wrong type. Does anyone know the simplest way of resolving this issue?

Change the file extension to .js.