问题描述:有时候会出现这样的现象:前端代码可以在IDE中正常运行和打包,但在浏览器调试窗口资源栏(源码)提示Uncaught SyntaxError: Unexpected token{ / identifier
(1)Uncaught SyntaxError: Unexpected token{ / identifier
****a:可能是当前浏览器不支持“裸”导入:
// 非裸导入: Supported:
import {
foo} from 'https://jakearchibald.com/utils/bar.mjs';
import {
foo} from '/utils/bar.mjs'