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

生产环境上传组件出现te.upload.addEventListener is not function 开发环境没有问题 #3270

Closed
XiaoHao520 opened this issue Nov 10, 2023 · 9 comments

Comments

@XiaoHao520
Copy link

描述 Bug

生产环境上传组件出现te.upload.addEventListener is not function 开发环境没有问题

复现 Bug

生产环境会出现,开发环境不会出现

系统信息

  • 操作系统:
  • Node 版本: 16
  • 包管理器 (npm/yarn/pnpm) 及其版本:pnpm
@wangjue666
Copy link
Collaborator

贴个你的复现代码

@XiaoHao520
Copy link
Author

就是你们标准版 拉下来之后马上 build 运行出来就有这个问题 ,这个问题element也存在
WechatIMG108

@sugar258596
Copy link

没有你这个问题啊,只有个接口问题
image

@XiaoHao520
Copy link
Author

这个是在接口之后触发的,最好能对接个接口测试一下,这边拉了最新的代码 build 之后人仍然存在这个问题,
这个链接是element同样存在的问题 可以参考下:http://www.bryh.cn/a/174994.html

@sugar258596
Copy link

image
我对接了接口也是没有问题的,可以正常上传

@sugar258596
Copy link

抱歉,抱歉,我这个是开发环境

@zanedeng
Copy link

image 因为你在生产环境开启了mock,mockjs重新实现了XMLHttpRequest这个类,upload对象没有实现。所以你如果在生产环境开启了mock就会出现如题的问题,在 .env.production 里把VITE_USE_MOCK = false

@XiaoHao520
Copy link
Author

感谢

@anncwb
Copy link
Collaborator

anncwb commented Apr 9, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@anncwb anncwb added the Stale label Apr 9, 2024
@anncwb anncwb closed this as completed Apr 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants