ES6 modules in local files - The server responded with a non-JavaScript MIME type

前端 未结 7 926
夕颜
夕颜 2020-11-28 07:07

I get this error:

Failed to load module script: The server responded with a non-JavaScript MIME type of \"\". Strict MIME type checking is enforced fo

7条回答
  •  醉酒成梦
    2020-11-28 07:36

    You can set the ModuleSpecifier to a data URI

    
    

    to set the ModuleSpecifier programmatically you can launch Chromium/Chrome with --allow-file-access-from-files flag and utilize XMLHttpRequest() to request a JavaScript file from file: protocol

    
    

提交回复
热议问题