0
点赞
收藏
分享

微信扫一扫

vue-particles 打包报错ypeError: ‘caller‘, ‘callee‘, and ‘arguments‘ properties may not be accessed on st

沉浸在自己的世界里 2022-03-21 阅读 107
vue.js

使用vue粒子特效报错TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
    at Function.Object.deepExtend

报错原因是因为在严格模式使用了arguments.callee

 

 可见vue-particles使用了particles.js 而在particles.js使用了arguments.callee,而这两个库都5年没有人更新了

解决方法:

1 取消webpack严格模式,这里不多说

2 将vue-particles和particles.js 都拷贝到src/lib文件下,下次就不使用npm安装了,

修改vue-particles引入路径

搜索arguments.callee修改 particles.js,将arguments.callee改为具名函数调用

 最后在vue-particles修改这个js引入路径

tips: 在package.json main属性可以看到你引入该库的路径,可以针对引入的文件去改

举报

相关推荐

vue项目打包,内存溢出报错

0 条评论