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

[toast] 找不到模块“tdesign-miniprogram/toast/index”或其相应的类型声明。 #2878

Open
matianhe3 opened this issue Jun 19, 2024 · 12 comments
Labels
question This is a question, not a bug

Comments

@matianhe3
Copy link

tdesign-miniprogram 版本

1.4.2

重现链接

No response

重现步骤

import Toast from "tdesign-miniprogram/toast/index";

期望结果

小程序可以运行, 但是开发者工具报错.

实际结果

image

基础库版本

3.4.6

补充说明

image
按照示例复制代码

Copy link
Contributor

👋 @matianhe3,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao
Copy link
Collaborator

anlyyao commented Jun 20, 2024

@matianhe3 开发工具上有勾选“将JS编译成ES5”选项吗

@anlyyao anlyyao added the question This is a question, not a bug label Jun 20, 2024
@matianhe3
Copy link
Author

@matianhe3 开发工具上有勾选“将JS编译成ES5”选项吗

勾选了
image

@anlyyao
Copy link
Collaborator

anlyyao commented Jul 3, 2024

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

@matianhe3
Copy link
Author

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

有没有typescript版的, 打开看是js的.

@anlyyao
Copy link
Collaborator

anlyyao commented Jul 5, 2024

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

有没有typescript版的, 打开看是js的.

没有本质区别

@matianhe3
Copy link
Author

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

有没有typescript版的, 打开看是js的.

没有本质区别

代码片段没有报错提示

@anlyyao
Copy link
Collaborator

anlyyao commented Jul 5, 2024

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

@matianhe3
Copy link
Author

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

https://developers.weixin.qq.com/s/UQqPzsmA7oSf

@anlyyao
Copy link
Collaborator

anlyyao commented Jul 5, 2024

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

https://developers.weixin.qq.com/s/UQqPzsmA7oSf

get到你说的"报错"了 🤦,改成 import { Toast } from 'tdesign-miniprogram';

@matianhe3
Copy link
Author

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

https://developers.weixin.qq.com/s/UQqPzsmA7oSf

get到你说的"报错"了 🤦,改成 import { Toast } from 'tdesign-miniprogram';

image
之前试过这样改, 会编译不成功.

@anlyyao
Copy link
Collaborator

anlyyao commented Jul 5, 2024

https://developers.weixin.qq.com/s/odzz7smx7FSP

我这边没能复现你控制台的报错、

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question, not a bug
Projects
None yet
Development

No branches or pull requests

2 participants