Vue血案:util.js:110 Uncaught SyntaxError: Unexpected token ':' at Object../node_modules/util/util.js

直接来看报错:
util.js:110 Uncaught SyntaxError: Unexpected token ':'
    at Object../node_modules/util/util.js (app.js:20943)
    at __webpack_require__ (app.js:679)
    at fn (app.js:89)
    at Object.eval (utils.js?a74e:2)
    at eval (utils.js:397)
    at Object../node_modules/elasticsearch/src/lib/utils.js (app.js:15540)
    at __webpack_require__ (app.js:679)
    at fn (app.js:89)
    at Object.eval (transport.js?953a:8)
    at eval (transport.js:524)

点进去看:

很容易看出,里面http开头的url应该是一个字符串。

来看看dev.env.js的配置:

应该把它改成和上面NODE_ENV一样格式的字符串。

如图:

记得重新npm run dev 一下,不然不生效

结果:

正常运行,没有报错。

请务必看到这里====

如果出现了一堆报错:Error occured while trying to proxy to:......

就是刚刚改了BASE_API出现的问题。

对于产生这个问题的前因后果,我也没有什么头猪,但是需要改代理配置文件:

在config/index.js 里面:

把代理用到的那个配置改回来就可以啦。

posted on 2022-06-22 11:37  northwest  阅读(358)  评论(0编辑  收藏  举报

导航