首页 > 其他分享 >Vue3 Vite 打包后页面报错 Function has non-object prototype 'undefined' in instanceof check

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

时间:2023-02-03 16:00:34浏览次数:95  
标签:Function instanceof undefined 报错 prototype 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遇到了很多问题

标签:Function,instanceof,undefined,报错,prototype,check,打包
From: https://www.cnblogs.com/cosmicbison/p/17089478.html

相关文章