其他分享
首页 > 其他分享> > vue-particles 打包报错ypeError: ‘caller‘, ‘callee‘, and ‘arguments‘ properties may not be accessed on st

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

作者:互联网

使用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,may,js,particles,报错,arguments,callee
来源: https://blog.csdn.net/qq_38317380/article/details/123639511