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

🐛[BUG] DrawerForm ssr 错误 : window is not defined #8243

Closed
edram opened this issue Mar 21, 2024 · 0 comments · Fixed by #8244
Closed

🐛[BUG] DrawerForm ssr 错误 : window is not defined #8243

edram opened this issue Mar 21, 2024 · 0 comments · Fixed by #8244

Comments

@edram
Copy link
Contributor

edram commented Mar 21, 2024

🐛 bug 描述

在 nextjs 使用 @ant-design/pro-form 中的 DrawerForm 组件 ,会提示 ⨯ ReferenceError: window is not defined

📷 复现步骤

见 bug 描述

🏞 期望结果

服务端渲染不报错

💻 复现代码

codesandbox

© 版本信息

  • ProComponents 版本: [e.g. 4.0.0]
  • 环境: node v18.19.0
  • 开发环境 windows 11

🚑 其他信息

image

这行代码会导致 ssr 报错

maxWidth: window.innerWidth * 0.8,

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