使用Polymer 2.0,我写了一个应用程序,其输入点是CMS中的一个页面。该页面加载polyfills,导入应用程序的输入点,并将自定义元素放入页面。此过程在铬和Firefox中效果很好。但是,在Edge中,存在一个问题。我在JavaScript控制台中遇到这样的错误:
Object doesn't support property or method 'PropertyEffects'
Unable to get property '__mixinSet' of undefined or null reference
Function is not a constructor
该应用程序正在使用常规,未构建的源代码。如何解释或解决这些错误?
您使用哪个版本的边缘?
来自聚合物服务来源的注释(https://github.com/polymer/polyserve/blob/master/src/compile-middleware.ts#l150(
// Note: The Edge user agent uses the EdgeHTML version, not the main
// release version (e.g. EdgeHTML 15 corresponds to Edge 40). See
// https://en.wikipedia.org/wiki/Microsoft_Edge#Release_history.
//
// Versions before 15.15063 may contain a JIT bug affecting ES6
// constructors (see #161).
因此,对于此版本,您仍然需要提供替代的ES5版本。
如果您使用的是polymer serve
,它将在需要时即时将ES6转移到ES5。
对于其他所有内容,您应该使用polymer build
提供ES5代码。然后,如果需要,您就可以使用。(通过用户代理字符串检查服务器(