Vue.js IE开发和构建因对象不存在而导致nuxt JS失败';不支持属性或方法或无法设置属性';溢出';指未定义的或空的引用
如果您了解我的nuxt应用程序在internet explorer上失败的原因,请告诉我。 在我的代码部分,我使用了array.includes(),我意识到IE不支持它,并删除了它,但它仍然不起作用。我确实使用了forEach循环,这应该得到IE11的支持 控制台错误:Vue.js IE开发和构建因对象不存在而导致nuxt JS失败';不支持属性或方法或无法设置属性';溢出';指未定义的或空的引用,vue.js,internet-explorer,nuxt.js,polyfills,babel-polyfill,Vue.js,Internet Explorer,Nuxt.js,Polyfills,Babel Polyfill,如果您了解我的nuxt应用程序在internet explorer上失败的原因,请告诉我。 在我的代码部分,我使用了array.includes(),我意识到IE不支持它,并删除了它,但它仍然不起作用。我确实使用了forEach循环,这应该得到IE11的支持 控制台错误: [Vuetify] [UPGRADE] 'v-content' is deprecated, use 'v-main' instead. found in ---> <VMain> <
[Vuetify] [UPGRADE] 'v-content' is deprecated, use 'v-main' instead.
found in
---> <VMain>
<VApp>
<Layouts/default.vue> at layouts/default.vue
<Root>
TypeError: Unable to set property 'overflow' of undefined or null reference
{
[functions]: ,
__proto__: { },
description: "Unable to set property 'overflow' of undefined or null reference",
message: "Unable to set property 'overflow' of undefined or null reference",
name: "TypeError",
number: -2146823281,
stack: "TypeError: Unable to set property 'overflow' of undefined or null reference
at setProp (eval code:7154:7)
at updateStyle (eval code:7215:7)
at invokeCreateHooks (eval code:6059:7)
at createElm (eval code:5946:11)
at createChildren (eval code:6043:9)
at createElm (eval code:5944:9)
at createChildren (eval code:6043:9)
at createElm (eval code:5944:9)
at createChildren (eval code:6043:9)
at createElm (eval code:5944:9)",
Symbol(Lang fallback)_i.cu2qu2ppg6q: undefined,
Symbol(react.element)_h.cu2qu2ppg6q: undefined
}
TypeError: Object doesn't support property or method 'values'
{
[functions]: ,
__proto__: { },
description: "Object doesn't support property or method 'values'",
message: "Object doesn't support property or method 'values'",
name: "TypeError",
number: -2146827850,
stack: "TypeError: Object doesn't support property or method 'values'
at Application.prototype.update (eval code:40041:5)
at Application.prototype.register (eval code:40031:5)
at callUpdate (eval code:36617:9)
at created (eval code:36603:7)
at invokeWithErrorHandling (eval code:1853:5)
at callHook (eval code:4213:7)
at Vue.prototype._init (eval code:4998:5)
at VueComponent (eval code:5144:7)
at createComponentInstanceForVnode (eval code:3280:3)
at init (eval code:3111:7)",
Symbol(Lang fallback)_i.cu2qu2ppg6q: undefined,
Symbol(react.element)_h.cu2qu2ppg6q: undefined
}
TypeError: Unable to get property 'parentNode' of undefined or null reference
{
[functions]: ,
__proto__: { },
description: "Unable to get property 'parentNode' of undefined or null reference",
message: "Unable to get property 'parentNode' of undefined or null reference",
name: "TypeError",
number: -2146823281,
stack: "TypeError: Unable to get property 'parentNode' of undefined or null reference
at parentNode (eval code:5711:3)
at patch (eval code:6503:9)
at Vue.prototype._update (eval code:3942:7)
at updateComponent (eval code:4054:7)
at get (eval code:4473:5)
at run (eval code:4548:5)
at flushSchedulerQueue (eval code:4304:5)
at Anonymous function (eval code:1979:9)
at flushCallbacks (eval code:1905:5)
at run (eval code:75:13)",
Symbol(Lang fallback)_i.cu2qu2ppg6q: undefined,
Symbol(react.element)_h.cu2qu2ppg6q: undefined
}
Package.json:
{
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.3.6",
"@nuxtjs/redirect-module": "^0.3.1",
"nuxt": "^2.12.2",
"vue-json-viewer": "^2.2.11",
"vue-quill-editor": "^3.0.6",
"vue-scrollto": "^2.18.1",
"vuetify-loader": "^1.5.0"
},
"devDependencies": {
"@nuxtjs/vuetify": "^1.0.0"
},
"resolutions": {
"@nuxt/**/terser": "3.14.1"
}
}
IE不支持HTMLCollection的
forEach
您可以在脚本中将以下polyfill添加到polyfillforEach
,然后它可以用于IE中的节点列表和HTMLCollection:
//polyfill
var ctors = [typeof NodeList !== "undefined" && NodeList, typeof HTMLCollection !== "undefined" && HTMLCollection];
for (var n = 0; n < ctors.length; ++n) {
var ctor = ctors[n];
if (ctor && ctor.prototype && !ctor.prototype.forEach) {
// (Yes, there's really no need for `Object.defineProperty` when doing the `forEach`)
ctor.prototype.forEach = Array.prototype.forEach;
if (typeof Symbol !== "undefined" && Symbol.iterator && !ctor.prototype[Symbol.iterator]) {
Object.defineProperty(ctor.prototype, Symbol.iterator, {
value: Array.prototype[Symbol.itereator],
writable: true,
configurable: true
});
}
}
}
//polyfill
变量系数=[typeof NodeList!=“undefined”&&NodeList,typeof HTMLCollection!=“undefined”&&HTMLCollection];
对于(变量n=0;nIE不支持HTMLCollection的forEach
您可以在脚本中将以下polyfill添加到polyfillforEach
,然后它可以用于IE中的节点列表和HTMLCollection:
//polyfill
var ctors = [typeof NodeList !== "undefined" && NodeList, typeof HTMLCollection !== "undefined" && HTMLCollection];
for (var n = 0; n < ctors.length; ++n) {
var ctor = ctors[n];
if (ctor && ctor.prototype && !ctor.prototype.forEach) {
// (Yes, there's really no need for `Object.defineProperty` when doing the `forEach`)
ctor.prototype.forEach = Array.prototype.forEach;
if (typeof Symbol !== "undefined" && Symbol.iterator && !ctor.prototype[Symbol.iterator]) {
Object.defineProperty(ctor.prototype, Symbol.iterator, {
value: Array.prototype[Symbol.itereator],
writable: true,
configurable: true
});
}
}
}
//polyfill
变量系数=[typeof NodeList!=“undefined”&&NodeList,typeof HTMLCollection!=“undefined”&&HTMLCollection];
对于(变量n=0;n
--更新
也许这会对将来的人有所帮助,但如果您有任何polyfill问题,无法在IE11和NUXTJS中使用ES5/6/7:
转到polyfill.io/v3/url-builder
然后选择所需的函数并获取链接,并以以下格式将其放入nuxt.config.js中:
head:{
script: [
{ src: 'https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=es5%2Ces6%2Ces7%2CArray.prototype.forEach%2CArray.prototype.includes%2CArray.prototype.values%2CString.prototype.includes' }
]}
我的问题是:无法设置未定义或空引用的属性“溢出”
追溯到SVG文件和foreignObject标记。--Update
也许这会对将来的人有所帮助,但如果您有任何polyfill问题,无法在IE11和NUXTJS中使用ES5/6/7:
转到polyfill.io/v3/url-builder
然后选择所需的函数并获取链接,并以以下格式将其放入nuxt.config.js中:
head:{
script: [
{ src: 'https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=es5%2Ces6%2Ces7%2CArray.prototype.forEach%2CArray.prototype.includes%2CArray.prototype.values%2CString.prototype.includes' }
]}
我的问题是:无法设置未定义或空引用的属性“溢出”
追溯到SVG文件和foreignObject标记。非常感谢您的回复。这让我更深入地研究它,解决了70%的问题。非常感谢。非常感谢您的回复。这让我更深入地研究它,解决了70%的问题。非常感谢。感谢您发布此问题的解决方案。您可以在48小时后将您的答案标记为可接受的答案,此时可进行标记。它可以在将来帮助其他社区成员解决类似的问题。感谢您的理解。感谢您发布此问题的解决方案。您可以在48小时后将您的答案标记为可接受的答案,此时可进行标记。它可以在将来帮助其他社区成员解决类似的问题。谢谢你的理解。