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

使用ssr时 customkeyboard引起的window undefined #2605

Closed
1 task done
BreathlessWay opened this issue May 31, 2018 · 1 comment
Closed
1 task done

使用ssr时 customkeyboard引起的window undefined #2605

BreathlessWay opened this issue May 31, 2018 · 1 comment

Comments

@BreathlessWay
Copy link

BreathlessWay commented May 31, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.11

Environment

mac os 10.13 , chrome

Reproduction link

https://github.com/ant-design/ant-design-mobile

Steps to reproduce

customkeyboard.js文件中判断ios平台的相关代码: var IS_IOS = /iphone|ipad|ipod/i.test(window.navigator.userAgent); 导致在使用服务端渲染时 会出现window undefined 的错误

What is expected?

添加平台判断,不报 window undefined 的错

What is actually happening?

会因为window undefined 报错

@ant-design-bot
Copy link

Translation of this issue:


When using ssr window undefined caused by customkeyboard

  • [] I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.11

Environment

Mac os 10.13 , chrome

Reproduction link

https://github.com/ant-design/ant-design-mobile

Steps to reproduce

The code in the customkeyboard.js file to determine the ios platform: var IS_IOS = /iphone|ipad|ipod/i.test(window.navigator.userAgent); causes window undefined error when using server rendering

What is expected?

Add platform judgment, do not report the error of window undefined

What is actually happening?

It will report error because of window undefined

KgTong added a commit that referenced this issue Jun 6, 2018
@warmhug warmhug closed this as completed in 6e66cf3 Jun 6, 2018
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

No branches or pull requests

2 participants