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

[微信小程序 - 动作面板] 真机调试,引入组件失败,程序报错 #754

Closed
HuziG opened this issue Aug 13, 2022 · 15 comments · Fixed by #2008
Closed

[微信小程序 - 动作面板] 真机调试,引入组件失败,程序报错 #754

HuziG opened this issue Aug 13, 2022 · 15 comments · Fixed by #2008
Labels
good first issue Good for newcomers in progress issue or pull request is in progress

Comments

@HuziG
Copy link

HuziG commented Aug 13, 2022

tdesign-miniprogram 版本

0.19.0

重现链接

No response

重现步骤

app.json - 全局引入了组件
"usingComponents": { "t-action-sheet": "tdesign-miniprogram/action-sheet/action-sheet" },

index.js - 使用组件
import ActionSheet, { ActionSheetTheme, } from "tdesign-miniprogram/action-sheet/index";

index.wxml - 使用组件
<t-action-sheet id="t-action-sheet" bind:selected="handleSelected" bind:cancel="handleCancel" />

在开发工具中正常运行,真机调试报错

期望结果

真机调试正常

实际结果

具体报错内容,如下 ~

MiniProgramError Error Error: Error line:1,column:751571,Error: module 'miniprogram_npm/tdesign-miniprogram/actionSheet/action-sheet.js' is not defined, require args is './action-sheet'

框架版本

微信小程序 2.25.2

浏览器版本

No response

系统版本

MacOS(11.6)

Node版本

16.13.1

补充说明

我的项目文件目录如下~

image

No response

@github-actions
Copy link
Contributor

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

@gxujin
Copy link

gxujin commented Aug 17, 2022

代码片段:
https://developers.weixin.qq.com/s/J2CKizmS7UBH

windows10环境

1、预览运行正常

2、模拟器运行,显示没有反应,控制台提示以下错误
Component is not found in path "miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet"

3、真机调试,提示以下错误:
Error: module 'miniprogram_npm/tdesign-miniprogram/action-sheet/action-sheet.js' is not defined, require args is './action-sheet'
Component is not found in path "components/action-sheet/index" (using by "index/index")

@LeeJim
Copy link
Collaborator

LeeJim commented Aug 31, 2022

我看下。

@LeeJim LeeJim added good first issue Good for newcomers in progress issue or pull request is in progress labels Aug 31, 2022
@LeeJim
Copy link
Collaborator

LeeJim commented Nov 21, 2022

我这边偶尔出发生,但重启开发者工具就没有这个问题。
我怀疑是开发者工具的缓存导致的

@zlsam
Copy link

zlsam commented Dec 7, 2022

不是缓存导致,我也遇到这个问题,只出现于首次编译运行到有该组件的页面会出现这个问题,刷新后就好了,暂时不用该组件,用了其他解决方案

@q8018414
Copy link

我发生情况刚好相反,如果我在页面配置引入该组件就会提示两个错误。
image
如果在全局配置引入该组件就没有问题。与你们的情况完全相反

@ElanYoung
Copy link
Contributor

我发生情况刚好相反,如果我在页面配置引入该组件就会提示两个错误。 image 如果在全局配置引入该组件就没有问题。与你们的情况完全相反

同样遇到

@wolf-leo
Copy link

我这边偶尔出发生,但重启开发者工具就没有这个问题。 我怀疑是开发者工具的缓存导致的

这个问题还没解决啊

@dorthl
Copy link

dorthl commented Feb 9, 2023

@LeeJim 或许这里不应该这样导出它
import ActionSheet from './action-sheet';

直接从show 文件中导出就不会再有问题了

import { ActionSheetTheme, show } from 'tdesign-miniprogram/action-sheet/show';

ActionSheet 是一个Component

@941477276
Copy link

我也遇到这个问题了,在苹果手机上真机调试就报错,在安卓手机上不会报错,真是奇怪

@minr
Copy link

minr commented Apr 11, 2023

一样遇到了,还没解决这个问题。

@hoveylee
Copy link

hoveylee commented Apr 20, 2023

我也遇到了,解决方案就是不开启按需注入就没有这个问题了。

@LeeJim LeeJim linked a pull request May 16, 2023 that will close this issue
16 tasks
@brainee
Copy link

brainee commented Apr 17, 2024

image

image

@ayuday
Copy link

ayuday commented Apr 28, 2024

同样遇这样问题,按官方的示例不成功

@oqughin
Copy link

oqughin commented Dec 18, 2024

我也遇到了,不知道该怎么解决。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers in progress issue or pull request is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.