Cannot use import statement outside a module : <p>I'm trying to use classes in pure JavaScript, so I'm facing the error "Uncaught SyntaxError: Cannot use import statement outside a module" and can't solve it.</p>

<p>File1.js - Main file</p>

<pre><code>import example from "./file2";

var test = new example();
</code></pre>

<p>File2.js - Class file</p>

<pre><code>export default class example {
    constructor() {
        console.log("hello world");
    }
}
</code></pre>
