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

[Vite + SSR] 使用 Vite + SSR 时报错 window is not defined #1588

Closed
WxSimon opened this issue Sep 13, 2024 · 1 comment · Fixed by #1589
Closed

[Vite + SSR] 使用 Vite + SSR 时报错 window is not defined #1588

WxSimon opened this issue Sep 13, 2024 · 1 comment · Fixed by #1589

Comments

@WxSimon
Copy link

WxSimon commented Sep 13, 2024

tdesign-mobile-vue 版本

1.4.1

重现链接

https://codesandbox.io/p/devbox/psjzqw

重现步骤

使用 vue3 + vite + ssr

服务启动报错 window is not defined

代码错误文件: tdesign-mobile-vue/cjs/_util/canUseDom.js:17:53

image

期望结果

服务正常打开,无任何报错

实际结果

image

报错: window is not defined

框架版本

vue(3.4.29) vite(5.3.1) express(4.19.2)

浏览器版本

No response

系统版本

No response

Node版本

v16.13.0

补充说明

No response

Copy link
Contributor

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

@WxSimon WxSimon changed the title [Vite + SSR] 是用 Vite + SSR 时报错 window is not defined [Vite + SSR] 使用 Vite + SSR 时报错 window is not defined Sep 13, 2024
@anlyyao anlyyao mentioned this issue Sep 13, 2024
16 tasks
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

Successfully merging a pull request may close this issue.

1 participant