Access to script at ‘file:///xxx/utils.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
problem
在html中通过script使用module类型的js文件
然后在本地以file方式打开
控制台报这个错
solution
将html文件和js文件放在ng下启动,可以解决
location /test {
alias /path/to/dist/;
index test1.html;
}