问题描述
做项目用到了MUI的scroll控件 故此我引入了mui.min.js
然而 猝不及防地报错了:
错误信息:
'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
原因
mui.js用到了’caller’, ‘callee’, 和 ‘arguments’
但webpack打包好的bundle.js默认是启用严格模式(strict mode)的
在严格模式下 不能使用’caller’, ‘callee’, 和 ‘arguments’
因此 这两者起了冲突 从而报错
解决方法
安装babel-plugin-transform-remove-strice-mode插件的办法在老版本的Babel是可以的
npm install babel-plugin-transform-remove-strict-mode
或是npm install @babel/plugin-transform-strict-mode
但在新版本的Babel中没用 依旧会报错
解决方法其实很简单:
在.bal