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

引用多端组件,ts无法识别,导致报错 #4529

Closed
sansx opened this issue Sep 25, 2019 · 2 comments
Closed

引用多端组件,ts无法识别,导致报错 #4529

sansx opened this issue Sep 25, 2019 · 2 comments

Comments

@sansx
Copy link

sansx commented Sep 25, 2019

问题描述
在文件夹内有fn.h5.tsfn.weapp.ts两个文件
在同级目录的其它文件下通过使用import * as fn from "./fn";引用模块
ts无法识别,显示找不到模块“./fn”。ts(2307)

复现步骤
[复现问题的步骤]

  1. 创建多个多端组件
  2. 通过import语法引入
  3. ts报错

期望行为
通过ts检查,最好是在global.d.ts文件下用某种声明方式通过检查

报错信息
找不到模块“./fn”。ts(2307)

系统信息
Taro CLI 1.3.17 environment info:
System:
OS: macOS 10.14.6
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.12.0 - /usr/local/bin/node
Yarn: 1.16.0 - ~/.npm-global/lib/node_modules/yarn/bin/yarn
npm: 6.8.0 - ~/.npm-global/bin/npm
npmPackages:
@tarojs/components: 1.3.17 => 1.3.17
@tarojs/mobx: 1.3.17 => 1.3.17
@tarojs/mobx-h5: 1.3.17 => 1.3.17
@tarojs/mobx-rn: 1.3.17 => 1.3.17
@tarojs/plugin-babel: 1.3.17 => 1.3.17
@tarojs/plugin-csso: 1.3.17 => 1.3.17
@tarojs/plugin-sass: 1.3.17 => 1.3.17
@tarojs/plugin-uglifyjs: 1.3.17 => 1.3.17
@tarojs/rn-runner: 1.3.17 => 1.3.17
@tarojs/router: 1.3.17 => 1.3.17
@tarojs/taro: 1.3.17 => 1.3.17
@tarojs/taro-alipay: 1.3.17 => 1.3.17
@tarojs/taro-h5: 1.3.17 => 1.3.17
@tarojs/taro-swan: 1.3.17 => 1.3.17
@tarojs/taro-tt: 1.3.17 => 1.3.17
@tarojs/taro-weapp: 1.3.17 => 1.3.17
@tarojs/webpack-runner: 1.3.17 => 1.3.17
eslint-config-taro: 1.3.17 => 1.3.17
eslint-plugin-taro: 1.3.17 => 1.3.17
nerv-devtools: ^1.4.0 => 1.4.4
nervjs: ^1.4.0 => 1.4.4
stylelint-config-taro-rn: 1.3.17 => 1.3.17
stylelint-taro-rn: 1.3.17 => 1.3.17
npmGlobalPackages:
typescript: 3.6.3

@taro-bot
Copy link

taro-bot bot commented Sep 25, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@sansx
Copy link
Author

sansx commented Sep 28, 2019

暂时使用ts-ignore跳过检查了

@sansx sansx closed this as completed Sep 28, 2019
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

1 participant