空白页和“未知名称" vue.esm.js中的错误(Microsoft IE 11和Microsoft Edge) [英] Blank page and "Unknown name" error in vue.esm.js (Microsoft IE 11 and Microsoft Edge)

查看:215
本文介绍了空白页和“未知名称" vue.esm.js中的错误(Microsoft IE 11和Microsoft Edge)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Internet Explorer 11和Microsoft Edge在加载我的Vue应用程序时显示空白页面.控制台日志显示一个未知名称"错误,指向vue.esm.js中的"throw e"行:

Internet Explorer 11 and Microsoft Edge shows me a blank page when loading my Vue app. Console logs shows an "Unknown name" error pointing to the line "throw e" in vue.esm.js:

Watcher.prototype.get = function get () {
pushTarget(this);
var value;
var vm = this.vm;
try {
value = this.getter.call(vm, vm);
} catch (e) {
if (this.user) {
handleError(e,vm, ("getter for watcher \"" + (this.expression) + "\""));
} else {
    throw e // UNKNOWN NAME ERROR (IE and Edge) 
}
} finally {
// "touch every property so the are all tracked as

我正在使用babel-polyfill(在main.js中导入:import'babel-polyfill').我的Package.json文件:

I am using babel-polyfill (imported in main.js: import 'babel-polyfill'). my Package.json file:

{
  "name": "xyz",
  "version": "1.0.0",
  "description": "xyz",
  "author": "xyz",
  "private": true,
  "scripts": {
    "dev": "node build/dev-server.js",
    "start": "node build/dev-server.js",
    "build": "node build/build.js",
    "lint": "eslint --ext .js,.vue src"
  },
  "dependencies": {
    "@xkeshi/image-compressor": "^0.5.2",
    "axios": "^0.17.1",
    "bulma": "^0.6.1",
    "bulma-extensions": "^0.5.2",
    "cropperjs": "^1.1.3",
    "vee-validate": "^2.0.0-rc.18",
    "vue": "^2.5.2",
    "vue-analytics": "^5.6.0",
    "vue-awesome-swiper": "^3.0.4",
    "vue-flatpickr-component": "^5.0.1",
    "vue-goodshare": "^0.9.2",
    "vue-masonry": "^0.10.16",
    "vue-meta": "^1.3.1",
    "vue-recaptcha": "^1.0.0",
    "vue-router": "^3.0.1",
    "vue-upload-component": "^2.6.3",
    "vue2-editor": "^2.3.11",
    "vue2-google-maps": "^0.8.4",
    "vuex": "^3.0.1",
    "vuex-persistedstate": "^2.4.2"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.5",
    "babel-core": "^6.26.0",
    "babel-eslint": "^8.0.1",
    "babel-loader": "^7.1.2",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-stage-2": "^6.24.1",
    "babel-register": "^6.26.0",
    "chalk": "^2.1.0",
    "connect-history-api-fallback": "^1.4.0",
    "copy-webpack-plugin": "^4.1.1",
    "css-loader": "^0.28.7",
    "cssnano": "^3.10.0",
    "eslint": "^4.9.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-html": "^3.2.2",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.2.0",
    "eslint-plugin-promise": "^3.6.0",
    "eslint-plugin-standard": "^3.0.1",
    "eventsource-polyfill": "^0.9.6",
    "express": "^4.16.2",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.5",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "http-proxy-middleware": "^0.17.4",
    "node-sass": "^4.7.2",
    "opn": "^5.1.0",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.3.0",
    "rimraf": "^2.6.2",
    "sass-loader": "^6.0.6",
    "semver": "^5.4.1",
    "shelljs": "^0.7.8",
    "sw-precache-webpack-plugin": "^0.11.4",
    "uglify-es": "^3.1.3",
    "url-loader": "^0.6.2",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.3",
    "vue-template-compiler": "^2.5.2",
    "webpack": "^3.8.1",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-middleware": "^1.12.0",
    "webpack-hot-middleware": "^2.21.0",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 4.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

我在vue-router中延迟加载路由,例如:

Im lazily loading the routes in vue-router, e.g.:

const Home = resolve => {
  require.ensure(['@/components/Home'], () => {
    resolve(require('@/components/Home'))
  })
}

仅在加载主页"组件时出现错误. Chrome,Firefox或Safari没问题.

I am getting the error just when loading my "Home" Component. No problems with Chrome, Firefox or Safari.

推荐答案

我发现了问题-是我的错误(语法).我的v-for循环中有:key:="xyz"(应该是:key ="xyz").

I have found the problem - was my mistake (syntax). I had :key:="xyz" in my v-for loop (should be :key="xyz").

这篇关于空白页和“未知名称" vue.esm.js中的错误(Microsoft IE 11和Microsoft Edge)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆