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

taro4.0.4引入原生echarts-for-weixin失败 #16503

Closed
RemEmilia opened this issue Sep 9, 2024 · 2 comments
Closed

taro4.0.4引入原生echarts-for-weixin失败 #16503

RemEmilia opened this issue Sep 9, 2024 · 2 comments

Comments

@RemEmilia
Copy link

相关平台

微信小程序

小程序基础库: 3.5.6
使用框架: React

复现步骤

①复制https://github.com/ecomfe/echarts-for-weixin的ec-canvas文件夹的内容到本地components下
②在分包的page.config.ts里面设置
export default {
usingComponents: {
// 定义需要引入的第三方组件
// 1. key 值指定第三方组件名字,以小写开头
// 2. value 值指定第三方组件 js 文件的相对路径
'ec-canvas': '../../../components/ec-canvas/ec-canvas',
},
}
③yarn dev:weapp
④报错component not found in the path: D:/lubanPro/weapp/dist/pages/components/ec-canvas/ec-canvas

期望结果

能成功使用组件

实际结果

报错component not found in the path: D:/lubanPro/weapp/dist/pages/components/ec-canvas/ec-canvas

环境信息

  Taro CLI 4.0.5 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
      npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.4 => 4.0.4 
      @tarojs/components: 4.0.4 => 4.0.4 
      @tarojs/helper: 4.0.4 => 4.0.4 
      @tarojs/plugin-framework-react: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-alipay: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-h5: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-jd: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-qq: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-swan: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-tt: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-weapp: 4.0.4 => 4.0.4
      @tarojs/react: 4.0.4 => 4.0.4
      @tarojs/runtime: 4.0.4 => 4.0.4
      @tarojs/shared: 4.0.4 => 4.0.4
      @tarojs/taro: 4.0.4 => 4.0.4
      @tarojs/taro-loader: 4.0.4 => 4.0.4
      @tarojs/webpack5-runner: 4.0.4 => 4.0.4
      babel-preset-taro: 4.0.4 => 4.0.4
      eslint-config-taro: 4.0.4 => 4.0.4
      react: ^18.0.0 => 18.3.1
      taro-ui: ^3.3.0 => 3.3.0
@RemEmilia RemEmilia reopened this Sep 10, 2024
@RemEmilia
Copy link
Author

usingComponents 路径要填打包成dist文件以后的路径,而不能是原路径

@RemEmilia
Copy link
Author

解决了

This was referenced Sep 14, 2024
@taro-bot2 taro-bot2 bot removed the to be closed label Oct 6, 2024
@taro-bot2 taro-bot2 bot closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants