Vue3 Vite 打包后页面报错 Function has non-object prototype 'undefined' in instanceof check

问题

原本可以正常打包部署运行,前两天加了些新功能,再打包就遇到这个问题,其意为:函数在instanceof check中具有非对象原型“undefined”

TypeError: Function has non-object prototype 'undefined' in instanceof check
    at [Symbol.hasInstance] (<anonymous>)
    at Function.o (index-23b873a3.js:9:77458)
    at commonFunc-7ade4e03.js:2:14389

image

解决

参考以前用vite打包遇到的各种问题:Vue3 Webpack项目迁移Vite问题记录——打包
先把代码混淆去掉,隐约觉得是类似遇到的问题,把qs卸载换成替代依赖,可以进入登录页了
这次的问题可能是把qs放到了devDependencies,导致打包后找不到?懒得去确认了,最近用qs遇到了很多问题

posted @ 2023-02-03 15:54  宇宙野牛  阅读(1615)  评论(0编辑  收藏  举报