控制台报错: Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode
这是js 文件中用到了 ‘caller’, ‘callee’, and ‘arguments’ 东西,但是, webpack 打包好的 bundle.js 中,默认是启用严格模式的,所以,这两者冲突了,解决方案就是去掉严格模式
解决方案: 1. 把 js 中的 非严格 模式的代码改掉;但是不现实;
2. 把 webpack 打包时候的严格模式禁用掉, 使用这个插件
babel-plugin-transform-remove-strict-mode
使用步骤(如图所示):
1.npm安装包:npm install babel-plugin-transform-remove-strict-mode -D
2.找到项目中的.babelrc文件,将transform-remove-strict-mode配置到.babelrc文件中的"plugins"中Uncaught TypeError: 'caller', 'callee', 'arguments' properties may not be accessed on strict mode
注意plugins是一个数组
Uncaught TypeError: 'caller', 'callee', 'arguments' properties may not be accessed on strict mode

相关文章:

  • 2021-08-25
  • 2022-02-05
  • 2022-03-02
  • 2021-05-15
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2021-11-30
  • 2022-12-23
  • 2021-11-17
  • 2021-08-29
相关资源
相似解决方案