Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序插件运行及引入taro-ui等第三方组件库报错 #6730

Open
EyeShield29 opened this issue Jun 17, 2020 · 9 comments
Open

小程序插件运行及引入taro-ui等第三方组件库报错 #6730

EyeShield29 opened this issue Jun 17, 2020 · 9 comments
Assignees
Labels
A-cli Area - CLI 相关 T-weapp Target - 编译到微信小程序 V-2 Version - 2.x

Comments

@EyeShield29
Copy link

问题描述

v2.2.8和v2.2.9都存在以下问题
问题1:运行报错
使用小程序插件命令编译后,在微信开发者工具中打开提示未找到入口 plugin.json 文件
需按照编译生成的文件目录层级将project.config.json中"pluginRoot": "plugin/"
修改为"pluginRoot": "miniprogram/miniprogram/plugin/"

问题2:引入taro-ui等第三方插件报错
以taro-ui为例,在初始化项目后,在插件plugin目录下引入taro-ui组件,编译后点击进入插件页面时提示Component is not found in path
"plugin-private://xxxxxxxxx/..npm/taro-ui/dist/weapp/components/button/index"

复现步骤

  1. taro init 选择 wxplugin
  2. 在src/plugin/pages/list/list.tsx使用taro-ui AtButton组件
  3. 运行编译指令 taro build --plugin weapp --watch
  4. 在页面上点击Go to pages/list!
  5. 提示Component is not found in path
    "plugin-private://xxxxxxxxx/..npm/taro-ui/dist/weapp/components/button/index"
/**
 * 这段注释后可以贴代码
 * 提供完整可复现的代码和整理好代码格式,有助于我们快速定位问题,节省你我时间
 * 代码提供不全或代码格式混乱的 issues 【有可能会被忽略】
 * 
 * 查看如何插入代码:https://coding.net/help/doc/project/markdown.html#i-5
 */

期望行为

调整plugin的编译生成目录,与project.config.json中保持一致
引入第三方组件使用正常,不报错

报错信息

SystemError (jsEnginScriptError)
Component is not found in path "plugin-private://xxxxxxxxx/..npm/taro-ui/dist/weapp/components/button/index" (using by "plugin-private://xxxxxxxxx/pages/list/list")
Error: Component is not found in path "plugin-private://xxxxxxxxx/..npm/taro-ui/dist/weapp/components/button/index" (using by "plugin-private://xxxxxxxxx/pages/list/list")
at e (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:1872190)
at e (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:1872391)
at http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:1896007
at Module._t (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:1896569)
at Function.value (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:1988290)
at jt (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:2004560)
at Mt (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:2007490)
at Function. (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:2017970)
at i. (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:1980628)
at i.emit (http://127.0.0.1:64000/appservice/__dev__/WAService.js:2:655930)

系统信息

Taro CLI 2.2.9 environment info:
System:
OS: Windows 10
Binaries:
Node: 14.4.0 - C:\soft\nodejs\node.EXE
Yarn: 1.22.4 - E:\node Files\node_global\yarn.CMD
npm: 6.14.5 - C:\soft\nodejs\npm.CMD

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

@easonzhuyi
Copy link

遇到同样的情况,非常重要的功能希望得到支持@Chen-jj

@Chen-jj Chen-jj added A-cli Area - CLI 相关 T-weapp Target - 编译到微信小程序 V-2 Version - 2.x and removed 微信小程序 labels Jul 9, 2020
@Chen-jj Chen-jj assigned luckyadam and unassigned Chen-jj Jul 9, 2020
@renruijun
Copy link

目前遇到【问题二】同样的问题,编译未报错,但是提示组件未找到。希望官方提供支持@Chen-jj

@luckyadam
Copy link
Member

2bbdaa5
这个 commit 修复了这个问题,2.2.12 可用

@daimashenjing
Copy link

V2.2.15又出现了同样的问题 是不是你同事覆盖了你的代码 这个都半个月了 没人解决了吗?

@PhantomRay
Copy link

PhantomRay commented Nov 3, 2020

散了吧。换其他框架。我难得选型失败。
3.x不成熟,2.x build的问题大半年都没解决。编译出来的小程序过于庞大。

你这个taro做出来的本意是什么?

@daimashenjing
Copy link

daimashenjing commented Nov 3, 2020

rn rn也不好好支持 啪 写完了发现坑了 (我还信誓旦旦的给老板说这个框架可以转换rn以后写app方便 啪啪打脸 )
还有就是taro-ui 到目前也不支持rn
rn 才是重点啊 好吧
去搞这个那个的小程序
目前用的多的也就 h5 微信 rn
我现在要重写rn代码 也是醉了

@racall
Copy link

racall commented Dec 2, 2020

@daimashenjing taro最开始是兼容小程序的 老哥

@daimashenjing
Copy link

@daimashenjing taro最开始是兼容小程序的 老哥

老哥 我说的是react native

@qicmsg
Copy link

qicmsg commented Mar 9, 2021

2bbdaa5
这个 commit 修复了这个问题,2.2.12 可用

2.2.13也可以用。但打包h5后有bug,升级到2.2.15,2.2.16后,h5问题解决了,但小程序又出现bug。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI 相关 T-weapp Target - 编译到微信小程序 V-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

9 participants