uniapp 微信小程序报 typeof4 is not a function?

warning: 这篇文章距离上次修改已过793天,其中的内容可能已经有所变动。

0.png0.png

1.png1.png

解决方法有两种:

  1. 修改一下 @babel/runtime/helpers/typeof.js 文件,内容修改为代码片段的。目的是添加"@babel/helpers - typeof";这一句在代码中,让babel识别出这是一个特殊的helper文件,不对它进行处理。
  2. 参考配置说明 https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html 修改一下 babelSetting 的 outputPath 成其他路径。
function _typeof2(o) {
    "@babel/helpers - typeof";
    return (_typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
        return typeof o;
  } : function(o) {
        return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
    })(o);
}

function _typeof(o) {
    return "function" == typeof Symbol && "symbol" === _typeof2(Symbol.iterator) ? module.exports = _typeof = function(o) {
        return _typeof2(o);
    } : module.exports = _typeof = function(o) {
        return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : _typeof2(o);
    }, _typeof(o);
}
module.exports = _typeof;

添加新评论