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

使用支付宝小程序基础库2.0构建小程序,Canvas显示不出来,不使用基础库2.0构建是正常的 #15767

Open
BS3385 opened this issue May 23, 2024 · 7 comments
Assignees
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x

Comments

@BS3385
Copy link

BS3385 commented May 23, 2024

相关平台

支付宝小程序

复现仓库

https://github.com/BS3385/taro-alipay-canvas-demo.git
小程序基础库: 2.9.12
使用框架: React

复现步骤

1、代码拉下后先安装依赖,node版本18.18.0,然后执行yarn dev:alipay
2、在支付宝的小程序开发者工具中打开编译后的目录,页面中canvas不显示,关闭基础库2.0构建之后可以正常显示

期望结果

canvas正常显示

实际结果

canvas在基础库2.0构建时未显示

环境信息

试过taro3.4.8及最新3.6.30都不行,实际项目使用的3.4.8,demo中是3.6.30

👽 Taro v3.6.30


  Taro CLI 3.6.30 environment info:
    System:
      OS: macOS 14.1.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v16.14.2/bin/yarn
      npm: 9.8.1 - ~/.nvm/versions/node/v18.18.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.30 => 3.6.30
      @tarojs/components: 3.6.30 => 3.6.30
      @tarojs/helper: 3.6.30 => 3.6.30
      @tarojs/plugin-framework-react: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-alipay: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-h5: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-jd: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-qq: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-swan: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-tt: 3.6.30 => 3.6.30
      @tarojs/plugin-platform-weapp: 3.6.30 => 3.6.30
      @tarojs/react: 3.6.30 => 3.6.30
      @tarojs/runtime: 3.6.30 => 3.6.30
      @tarojs/shared: 3.6.30 => 3.6.30
      @tarojs/taro: 3.6.30 => 3.6.30
      @tarojs/taro-loader: 3.6.30 => 3.6.30
      @tarojs/webpack5-runner: 3.6.30 => 3.6.30
      babel-preset-taro: 3.6.30 => 3.6.30
      eslint-config-taro: 3.6.30 => 3.6.30
      react: ^18.0.0 => 18.3.1

@taro-bot2 taro-bot2 bot added F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x labels May 23, 2024
@BS3385
Copy link
Author

BS3385 commented May 23, 2024

不启用基础库2.0构建
image

启用基础库2.0构建
image

@BS3385
Copy link
Author

BS3385 commented May 23, 2024

支付宝小程序是必须启用2.0构建的,可以切换到mpaas小程序,可以切换是否启用基础库2.0构建,我们的小程序也是mpaas小程序

@BS3385
Copy link
Author

BS3385 commented May 24, 2024

@Chen-jj @yuche @luckyadam 这个问题好长时间了,对业务产生影响,希望有人能看看

@BS3385
Copy link
Author

BS3385 commented May 24, 2024

image
咨询过支付宝方面,排查下来说是taro的问题

@BS3385
Copy link
Author

BS3385 commented May 24, 2024

尝试将canvas的type="2d"属性删除,发现可以展示了

@BS3385
Copy link
Author

BS3385 commented May 24, 2024

尝试将canvas的type="2d"属性删除,发现可以展示了

支付宝方面说type="2d" 是用新版本的Canvas,去掉的话是创建的旧版的 canvas,所以说这个问题还需要官方再关注下

@koppthe
Copy link
Contributor

koppthe commented May 25, 2024

了解,感谢反馈问题~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants