[英]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) 时,返回的值将是最后一个假值,在这种情况下,未定义,并且你不能对未定义的值执行方法调用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.