Closed liudonghua123 closed 3 years ago
尝试运行 yarn dev:weapp
也提示i错误
(common) D:\code\weixin\taro-antd-mobile>yarn dev:weapp
yarn run v1.22.10
$ npm run build:weapp -- --watch
> taro-antd@1.0.0 build:weapp
> taro build --type weapp "--watch"
👽 Taro v3.2.2-beta.0
D:\code\weixin\taro-antd-mobile\node_modules\@tarojs\plugin-html\dist\index.js:14
ctx.onParseCreateElement(({ nodeName, componentConfig }) => {
^
TypeError: ctx.onParseCreateElement is not a function
at exports.default (D:\code\weixin\taro-antd-mobile\node_modules\@tarojs\plugin-html\src\index.ts:33:7)
at Kernel.initPlugin (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:118:16)
at Kernel.resolvePlugins (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:93:18)
at Kernel.initPresetsAndPlugins (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:81:14)
at Kernel.<anonymous> (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:40:18)
at Generator.next (<anonymous>)
at C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:8:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:4:12)
at Kernel.init (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\@tarojs\cli\node_modules\@tarojs\service\dist\Kernel.js:36:16)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(common) D:\code\weixin\taro-antd-mobile>yarn why @tarojs\plugin-html
yarn why v1.22.10
[1/4] Why do we have the module "@tarojs\\plugin-html"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@tarojs/plugin-html@3.3.0-alpha.2"
info Has been hoisted to "@tarojs/plugin-html"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "68KB"
info Disk size with unique dependencies: "372KB"
info Disk size with transitive dependencies: "372KB"
info Number of shared dependencies: 1
Done in 0.98s.
(common) D:\code\weixin\taro-antd-mobile>
如果我暂时注释掉node_modules\@tarojs\plugin-html\dist\index.js
中的 ctx.onParseCreateElement
/ctx.modifyComponentConfig
. 则yarn dev:h5
/yarn dev:weapp
可以运行,没有再报错了。
似乎是@tarojs\plugin-html
的版本与其他组件不匹配。
看我这个issue #2
文档有误,需要安装 alpha 版本
npm i @tarojs/cli@alpha -g