title: OnChange function not defined when I reference my script as a module?
body: <p>I have a piece of code that implements Cropper.js for interactive cropping of an image. Unfortunately, chrome gives the error</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: onFileSelected is not defined
        at HTMLInputElement.onchange ((index):35),"</p>
  </blockquote>
  
  <p>despite the fact that these functions are clearly defined, when I reference my scripts.js file as</p>
  
  <pre><code>&lt;script type="module" src="js/scripts.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>&lt;script type="text/javascript" src="js/scripts.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Am I missing something here? Can a script that as loaded as a module not be used for these onchange events? Any help would be appreciated</p>