Vue-cli: vue cli3 创建的项目在IE11中运行,出现白屏,通过console调试发现报错SCRIPT1003: 缺少 ':'文件: app.js,行: 7391,列: 3

Created on 11 Jun 2019  ·  4Comments  ·  Source: vuejs/vue-cli

Version

3.8.2

Reproduction link

https://github.com/GeekQiaQia/tempJob.git

Environment info

 System:
    OS: Windows 7
    CPU: (4) x64 Intel(R) Core(TM) i3-6100T CPU @ 3.20GHz
  Binaries:
    Node: 10.15.3 - D:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.4.1 - D:\Program Files\nodejs\npm.CMD
  npmPackages:
    @vue/babel-preset-app:  3.2.2
    @vue/cli-overlay:  3.2.0
    @vue/cli-plugin-babel: ^3.2.0 => 3.2.2
    @vue/cli-service: ^3.2.0 => 3.2.3
    @vue/cli-shared-utils:  3.2.2
    @vue/component-compiler-utils:  2.4.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/web-component-wrapper:  1.2.0
    babel-helper-vue-jsx-merge-props:  2.0.3
    babel-plugin-transform-vue-jsx:  4.0.1
    vue: ^2.5.21 => 2.5.21
    vue-class-component: ^7.1.0 => 7.1.0
    vue-cropperjs: ^3.0.0 => 3.0.0
    vue-hot-reload-api:  2.3.1
    vue-loader:  15.5.0
    vue-offline: ^2.0.8 => 2.0.8
    vue-quill-editor: ^3.0.6 => 3.0.6
    vue-router: ^3.0.1 => 3.0.2
    vue-schart: ^1.0.0 => 1.0.0
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.21 => 2.5.21
    vue-template-es2015-compiler:  1.6.0
    vuedraggable: ^2.17.0 => 2.19.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

在github 下载项目,执行npm i ,执行npm run dev; 此时启动:http://localhost:8080;将http://localhost:8080输入到IE11 地址栏;显示白屏,非IE浏览器正常显示;

What is expected?

在IE9/10/11 能够正常运行显示;

What is actually happening?

IE11 显示空白,
console:
SCRIPT1003: 缺少 ':'
文件: app.js,行: 7391,列: 3


我尝试了issue里面的相似的问题的解决方法,并且是已经关闭的issue;都么有起作用;

Most helpful comment

vue.config.js
transpileDependencies: process.env.NODE_ENV === 'development' ? ['*'] : [], // 解决npm run serve某些node_modules依赖不能被babel编译问题

All 4 comments

代码里引用 element-ui 的方式错了。
element-ui/src/ 开头的几个引用全改成 element-ui/lib/ 开头就行了。

vue.config.js
transpileDependencies: process.env.NODE_ENV === 'development' ? ['*'] : [], // 解决npm run serve某些node_modules依赖不能被babel编译问题

vue.config.js
transpileDependencies: process.env.NODE_ENV === 'development' ? ['*'] : [], // 解决npm run serve某些node_modules依赖不能被babel编译问题

弄了一天,大佬一行代码帮我解决了66666666....

我也出现了这个问题。点击错误提示定位到打包后的代码中,往上移动看到
/*!**********************************************************************************!*\ !*** ./node_modules/[email protected]@vuetify/lib/components/transitions/index.js ***! \**********************************************************************************/
我使用的UI组件库是vuetify, transpileDependencies中也已添加vuetify。可是还是有这个问题。

Was this page helpful?
0 / 5 - 0 ratings