安装第三方包 @baidu/ug-swan-utils
然后执行 yarn run dev:swan
报错如下:
taro2-test/node_modules/@baidu/ug-swan-utils/dist/index.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "StringLiteral"
at Object.validate (/taro2-test/node_modules/babel-types/lib/definitions/index.js:109:13)
at Object.validate (/taro2-test/node_modules/babel-types/lib/index.js:505:9)
at NodePath._replaceWith (/taro2-test/node_modules/babel-traverse/lib/path/replacement.js:176:7)
at NodePath.replaceWith (/taro2-test/node_modules/babel-traverse/lib/path/replacement.js:160:8)
at replaceAndEvaluateNode (/taro2-test/node_modules/babel-plugin-transform-define/lib/index.js:117:12)
at processNode (/taro2-test/node_modules/babel-plugin-transform-define/lib/index.js:143:5)
at PluginPass.Identifier (/taro2-test/node_modules/babel-plugin-transform-define/lib/index.js:23:9)
at newFn (taro2-test/node_modules/babel-traverse/lib/visitors.js:276:21)
at NodePath._call (/taro2-test/node_modules/babel-traverse/lib/path/context.js:76:18)
at NodePath.call (/taro2-test/node_modules/babel-traverse/lib/path/context.js:48:17)
at NodePath.visit (/taro2-test/node_modules/babel-traverse/lib/path/context.js:105:12)
at TraversalContext.visitQueue (/taro2-test/node_modules/babel-traverse/lib/context.js:150:16)
at TraversalContext.visitSingle (/taro2-test/node_modules/babel-traverse/lib/context.js:108:19)
at TraversalContext.visit (/taro2-test/node_modules/babel-traverse/lib/context.js:192:19)
at Function.traverse.node (/taro2-test/node_modules/babel-traverse/lib/index.js:114:17)
at NodePath.visit (/taro2-test/node_modules/babel-traverse/lib/path/context.js:115:19) _babel: true }
/taro2-test/node_modules/@baidu/ug-swan-utils/dist/index.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "StringLiteral"
期望结果
不会报这种类型错误
实际结果
出现报类型错误:Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "StringLiteral"
相关平台
百度小程序
小程序基础库: 也版本无关 使用框架: React
复现步骤
安装第三方包 @baidu/ug-swan-utils 然后执行 yarn run dev:swan
报错如下: taro2-test/node_modules/@baidu/ug-swan-utils/dist/index.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "StringLiteral"
🙅 编译失败.
./node_modules/@baidu/ug-swan-utils/dist/index.js Module Error (from ./node_modules/@tarojs/mini-runner/dist/loaders/wxTransformerLoader.js):
/taro2-test/node_modules/@baidu/ug-swan-utils/dist/index.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "StringLiteral"
期望结果
不会报这种类型错误
实际结果
出现报类型错误:Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "StringLiteral"
环境信息