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

3.3.10升级到3.3.11,在服务端渲染中会报window is undefined #1631

Closed
li-jia-nan opened this issue May 16, 2022 · 5 comments · Fixed by #1632
Closed

3.3.10升级到3.3.11,在服务端渲染中会报window is undefined #1631

li-jia-nan opened this issue May 16, 2022 · 5 comments · Fixed by #1632

Comments

@li-jia-nan
Copy link
Collaborator

li-jia-nan commented May 16, 2022

3.3.10升级到3.3.11,在服务端渲染中会报window is undefined,回退到3.3.10报错消失

@li-jia-nan li-jia-nan changed the title 3.3.10升级到3.3.11,在服务端渲染中会报window in undefined 3.3.10升级到3.3.11,在服务端渲染中会报window is undefined May 16, 2022
@li-jia-nan li-jia-nan reopened this May 16, 2022
@brickspert
Copy link
Collaborator

能贴下具体的报错地方吗

@u3u
Copy link

u3u commented May 16, 2022

return !!(!isUndef(window) && window.document && window.document.createElement);

这里只能用 typeof window !== 'undefined'

@hchlq
Copy link
Collaborator

hchlq commented May 16, 2022

我了解了,之前typeof 有个暂存性死区 @brickspert ,目前在服务器访问,导致的报错

@li-jia-nan
Copy link
Collaborator Author

能贴下具体的报错地方吗

hooks/packages/hooks/src/utils/canUseDom.ts

@brickspert
Copy link
Collaborator

[email protected]

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.

4 participants