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

升级vue-cli从4.5.0直接通过命令vue upgrade升级到5.0.8后,页面在ios12和ios13上白屏了,代码无法执行 #7337

Open
XdYangXiaoRong opened this issue Dec 5, 2022 · 5 comments

Comments

@XdYangXiaoRong
Copy link

Version

5.0.8

Environment info

  "@vue/cli-plugin-babel": "~5.0.8",
    "@vue/cli-plugin-eslint": "~5.0.8",
    "@vue/cli-plugin-router": "~5.0.8",
    "@vue/cli-plugin-typescript": "~5.0.8",
    "@vue/cli-plugin-unit-jest": "~5.0.8",
    "@vue/cli-plugin-vuex": "~5.0.8",
    "@vue/cli-service": "~5.0.8",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^9.1.0",
    "@vue/test-utils": "^1.0.3",
    "@vue/vue2-jest": "^29.2.0",

Steps to reproduce

vue-cli生成最新版本的vue模板,并在低版本的ios(12, 13及以下)上运行,即可复现。

What is expected?

页面在ios12,ios13甚至更低的版本都能正常展示。

What is actually happening?

页面在ios12,ios上白屏。


本地打包不报错,在高版本的ios上也不报错,但是在ios13及以下的版本会白屏。

@sodatea
Copy link
Member

sodatea commented Dec 6, 2022

应该是 browserslist 升级的问题。你往 .browserslistrc 文件追加一行 ios_saf 12.0 应该就可以了。

@XdYangXiaoRong
Copy link
Author

应该是 browserslist 升级的问题。你往 .browserslistrc 文件追加一行 ios_saf 12.0 应该就可以了。

但是我自己用vue-cli5 create一个项目,里面的配置也是和旧项目一样的,这里说不支持ios12,13,但是大概率是更低一点的版本也是不支持的。
按理来说工具升级还是要考虑兼容旧的版本,这种问题要怎么彻底避免呢?如果不是用户量足够,然后有客诉,这种问题在开发阶段根本不可能被发现,辛苦大佬帮忙看看。

@XdYangXiaoRong
Copy link
Author

应该是 browserslist 升级的问题。你往 .browserslistrc 文件追加一行 ios_saf 12.0 应该就可以了。

我对比了4.5.19(正常版本)和5.0.8(异常版本)的browserslist,两个是一样的,没有区别,都是:
and_chr 107
and_ff 106
and_qq 13.1
and_uc 13.4
android 107
chrome 108
chrome 107
chrome 106
chrome 105
edge 107
edge 106
firefox 107
firefox 106
firefox 105
ios_saf 16.1
ios_saf 16.0
ios_saf 15.6
kaios 2.5
op_mini all
op_mob 72
opera 92
opera 91
safari 16.1
safari 16.0
safari 15.6
samsung 19.0
samsung 18.0

@WesleyF
Copy link

WesleyF commented Feb 3, 2023

Have a similar issue, some error in the inspector console.
WebSocket connection to 'ws://10.0.0.249:8080/ws' failed. There was a bad request from the server.

figured out during the weekend. It seems to work after turning off NSURLSession WebSocket in the Safari experiment features.

@LuoRiWuSheng
Copy link

我没有配置 postcss, 也去掉了browserslistrc 文件, 目前项目好像没啥问题, 也是 webpack 5.0.8

https://juejin.cn/post/7298646156438355968

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

4 participants