vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

android6 chrome44 白屏 #6369

Open 13191868165 opened 3 years ago

13191868165 commented 3 years ago

Version

4.5.12

Environment info

  System:
    OS: Windows 10 10.0.19041
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  Binaries:
    Node: 13.14.0 - D:\nodejs\node.EXE
    Yarn: 1.22.4 - D:\Yarn\bin\yarn.CMD
    npm: 6.14.4 - D:\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.423.0), Chromium (89.0.774.57)
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.0.3
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  4.5.12
    @vue/babel-preset-jsx:  1.2.4
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.4
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli-overlay:  4.5.12
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.12
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.12
    @vue/cli-plugin-router:  4.5.12
    @vue/cli-plugin-vuex:  4.5.12
    @vue/cli-service: ~4.5.0 => 4.5.12
    @vue/cli-shared-utils:  4.5.12
    @vue/compiler-core:  3.0.7
    @vue/compiler-dom:  3.0.7
    @vue/compiler-sfc: ^3.0.0 => 3.0.7
    @vue/compiler-ssr:  3.0.7
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/reactivity:  3.0.7
    @vue/runtime-core:  3.0.7
    @vue/runtime-dom:  3.0.7
    @vue/shared:  3.0.7
    @vue/web-component-wrapper:  1.3.0
    eslint-plugin-vue: ^7.0.0 => 7.7.0
    vue: ^3.0.0 => 3.0.7
    vue-eslint-parser:  7.6.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.9.6 (16.1.2)
    vue-style-loader:  4.1.3
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. 按照Vue Cli文档创建一个项目(Vue 3 Preview) 文档地址:https://cli.vuejs.org/zh/guide/creating-a-project.html#vue-create

  2. 运行项目:npm run serve 低版本的android系统(webview:chrome 44)里面会出现白屏 错误信息:

    Uncaught SyntaxError: Unexpected token )
    push../node_modules/vue/dist/vue.runtime.esm-bundler.js @ chunk-vendors.js:1283
    __webpack_require__ @ app.js:849
    fn @ app.js:151
    (anonymous function) @ main.js:10
    ./src/main.js @ app.js:1148
    __webpack_require__ @ app.js:849
    fn @ app.js:151
    1 @ app.js:1161
    __webpack_require__ @ app.js:849
    checkDeferredModules @ app.js:46
    (anonymous function) @ app.js:925
    (anonymous function) @ app.js:928

解决方案:

//vue.config.js
module.exports = {
    transpileDependencies: [
        '@vue', 'vue'
    ],
};
  1. npm run build && npm run serve出现新的问题:
    Uncaught SyntaxError: Unexpected token )                                    App.vue?97f5:14 
    ./src/App.vue @ app.js:1099
    __webpack_require__ @ app.js:854
    fn @ app.js:151
    (anonymous function) @ main.ts:11
    ./src/main.ts @ app.js:1135
    __webpack_require__ @ app.js:854fn @ app.js:1511
     @ app.js:1207
    __webpack_require__ @ app.js:854
    checkDeferredModules @ app.js:46
    (anonymous function) @ app.js:994
    (anonymous function) @ app.js:997

What is expected?

我们的一个项目已经在用vue3开发了,项目中的硬件是android6.0,webview是chrome44,需要项目兼容chrome44,有没有什么解决方案来解决兼容的问题? 或者官方的兼容会不会考虑chrome44,短期内有没有计划更新(我看babel-preset-app里面chrome >= 46)

What is actually happening?

yoyo930021 commented 3 years ago

The reactive system is based on Proxy API in Vue 3.

Proxy is supported by chrome 49 up. https://caniuse.com/proxy

So, I think you need to use vue 2 or drop support chrome 44.

13191868165 commented 3 years ago

The reactive system is based on Proxy API in Vue 3.

Proxy is supported by chrome 49 up. https://caniuse.com/proxy

So, I think you need to use vue 2 or drop support chrome 44.

感谢你的回复,使用vue2可以解决兼容的问题(我已经确认过了)。 我们的项目基于ionic5 + vue3做Hybrid App,如果要用vue2可能需要更换开发框架(我们有app+小程序两个版本都是基于ts开发的),目前我们做调研只剩下这一个问题未解决。 如果该问题没有合适的解决方案,我们备用方案是基于vue2做个wap版本

habc0807 commented 3 years ago

@y13818463245 问题解决了吗?后来用了备用方案吗?

13191868165 commented 3 years ago

@y13818463245 问题解决了吗?后来用了备用方案吗?

没解决,之前vue3的开发计划第二季度解决兼容问题,后来前阵子官方发布通知放弃了兼容低版本了。 我只能做个wap版本来解决。

habc0807 commented 3 years ago

@y13818463245 问题解决了吗?后来用了备用方案吗?

没解决,之前vue3的开发计划第二季度解决兼容问题,后来前阵子官方发布通知放弃了兼容低版本了。 我只能做个wap版本来解决。

好吧,本来还想做个升级,看来暂时是不能推行vue3了。