简体   繁体   English

未捕获的类型错误:使用聚合物硫化后无法读取未定义的属性“修剪”

[英]Uncaught TypeError: Cannot read property 'trim' of undefined after using Polymer vulcanize

My application based on Polymer-PSK+ and ES2015 .我的应用程序基于Polymer-PSK+ES2015 Using my distributed version of the application I'll receive the following error: Uncaught TypeError: Cannot read property 'trim' of undefined (elements.js line 5832)使用我的应用程序的分布式版本时,我会收到以下错误: Uncaught TypeError: Cannot read property 'trim' of undefined (elements.js line 5832)

The reason for this is due to 'missing' properties of Polymer paper-input-container-underline element, see:其原因是由于 Polymer paper-input-container-underline 元素的“缺失”属性,请参阅:

形象

形象

The assignment to properties[m[1]] fails due to (m[2] || m[3]).trim();由于(m[2] || m[3]).trim();properties[m[1]]的赋值失败(m[2] || m[3]).trim(); : m[2] = "" and m[3] = undefined : m[2] = "" and m[3] = undefined

Any hints how to solve this problem and how to use the distributed version of my application?任何提示如何解决这个问题以及如何使用我的应用程序的分布式版本?

On javascript, both empty strings ("") and the undefined value considered falsy values.在 javascript 上,空字符串 ("") 和未定义的值都被视为虚假值。

so when you write ("" || undefined), the returned value will be the last falsy value, on this case, undefined, and you cannot perform method calls on an undefined value.所以当你写 ("" || undefined) 时,返回的值将是最后一个假值,在这种情况下,未定义,并且你不能对未定义的值执行方法调用。

you can read about it here.你可以在这里阅读它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的类型错误:无法读取未定义的属性“修剪” - Uncaught TypeError: Cannot read property 'trim' of undefined 未捕获的类型错误:无法读取 Jquery 中未定义的属性“修剪” - Uncaught TypeError: Cannot read property 'trim' of undefined in Jquery Polymer:未捕获的TypeError:无法读取未定义的属性“ persistent” - Polymer: Uncaught TypeError: Cannot read property 'persistent' of undefined react-TypeError:无法读取未定义的属性'trim' - react - TypeError: Cannot read property 'trim' of undefined KineticJS未捕获的TypeError:更新后无法读取未定义的属性“ x” - KineticJS Uncaught TypeError: Cannot read property 'x' of undefined after Update 定义 var 后“未捕获的类型错误:无法读取未定义的属性‘长度’” - "Uncaught TypeError: Cannot read property 'length' of undefined" after defining var 未捕获的TypeError:在Ajax调用后无法读取未定义的属性'appendChild' - Uncaught TypeError: Cannot read property 'appendChild' of undefined after Ajax call 未捕获的TypeError:querySelectorAll之后无法读取未定义的属性“值” - Uncaught TypeError: Cannot read property 'value' of undefined after querySelectorAll 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined 聚合物 3 纸对话框:未捕获的类型错误:无法读取未定义的属性“对话框” - Polymer 3 paper-dialog: Uncaught TypeError: Cannot read property 'dialog' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM