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

app.config中类型错误 #11414

Closed
yujingwyh opened this issue Mar 8, 2022 · 1 comment · Fixed by #11657
Closed

app.config中类型错误 #11414

yujingwyh opened this issue Mar 8, 2022 · 1 comment · Fixed by #11657
Labels
A-typings Area - TypeScript Typings 相关 E-easy Helper Wanted - Easy F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@yujingwyh
Copy link

相关平台

微信小程序

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

复现步骤

以下typescript会提示类型错误,
实际上subpackages是支持plugins属性的

//版本:3.4.1
//app.config.js

export default defineAppConfig({
  pages: [
    "pages/test/index",
  ],
  subpackages: [
    {
      root: "pages/workbench",
      pages: [
        "announcement/index",
      ],
      plugins: {
        "test": {
          version: "1.0.0",
          provider: "",
        },
      },
    },
  ],
})

期望结果

SubPackage类型支持plugins属性

实际结果

不能将类型“{ root: string; pages: string[]; plugins: { "ysxs-plugins": { version: string; provider: string; }; }; }”分配给类型“SubPackage”。
对象文字可以只指定已知属性,并且“plugins”不在类型“SubPackage”中。

环境信息

Taro v3.4.2


  Taro CLI 3.4.2 environment info:
    System:
      OS: macOS 12.2.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node
      npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm
    npmPackages:
      @tarojs/components: 3.4.1 => 3.4.1
      @tarojs/mini-runner: 3.4.1 => 3.4.1
      @tarojs/runtime: 3.4.1 => 3.4.1
      @tarojs/taro: 3.4.1 => 3.4.1
      @tarojs/webpack-runner: 3.4.1 => 3.4.1
      babel-preset-taro: 3.4.1 => 3.4.1
      eslint-config-taro: 3.4.1 => 3.4.1
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2022

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

@Chen-jj Chen-jj added A-typings Area - TypeScript Typings 相关 E-easy Helper Wanted - Easy labels Mar 12, 2022
@Chen-jj Chen-jj added this to the 3.4.7 milestone Apr 15, 2022
@Chen-jj Chen-jj linked a pull request Apr 15, 2022 that will close this issue
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typings Area - TypeScript Typings 相关 E-easy Helper Wanted - Easy F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants