简体   繁体   English

Polymer 2.0 Edge问题

[英]Polymer 2.0 Edge Issue

Using Polymer 2.0, I wrote an app whose entry point is a page in a CMS. 使用Polymer 2.0,我编写了一个应用程序,其入口点是CMS中的页面。 The page loads the polyfills, imports the app's entry point, and puts the custom element into the page. 该页面将加载polyfills,导入应用程序的入口点,然后将自定义元素放入页面中。 This process works well in Chrome and Firefox; 此过程在Chrome和Firefox中运行良好; in Edge, however, there is a problem. 但是,在Edge中存在问题。 I'm getting errors like this in the JavaScript console: 我在JavaScript控制台中收到这样的错误:

Object doesn't support property or method 'PropertyEffects'

Unable to get property '__mixinSet' of undefined or null reference

Function is not a constructor

The app is using the regular, unbuilt source code. 该应用程序正在使用常规的未构建源代码。 How can these errors be interpreted or resolved? 如何解释或解决这些错误?

Which Version of Edge do you use? 您使用哪个版本的Edge?

Note from polymer serve source ( https://github.com/Polymer/polyserve/blob/master/src/compile-middleware.ts#L150 ) 来自聚合物服务源的注释( 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).

So for Edge up to this version you still need to provide an alternative ES5 Version. 因此,对于直到此版本的Edge,您仍然需要提供备用ES5版本。

If you are using polymer serve it will transpile your ES6 to ES5 on the fly if needed. 如果您使用的是polymer serve则可以根据需要将ES6即时转换为ES5。

For everything else you should use polymer build to provide ES5 code. 对于其他所有内容,您都应该使用polymer build来提供ES5代码。 Which you then serve if needed. 然后根据需要为您服务。 (check on server via user agent string) (通过用户代理字符串在服务器上检查)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM