【问题标题】:Polymer 2.0 Edge IssuePolymer 2.0 边缘问题
【发布时间】:2017-06-03 07:46:21
【问题描述】:

使用 Polymer 2.0,我编写了一个应用程序,其入口点是 CMS 中的页面。页面加载 polyfill,导入应用程序的入口点,并将自定义元素放入页面。这个过程在 Chrome 和 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

该应用正在使用常规的、未构建的源代码。如何解释或解决这些错误?

【问题讨论】:

    标签: javascript polymer polymer-2.x


    【解决方案1】:

    您使用哪个版本的 Edge?

    来自聚合物服务来源 (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).
    

    所以对于这个版本的 Edge,你仍然需要提供一个替代的 ES5 版本。

    如果您使用的是polymer serve,它会在需要时将您的 ES6 即时转换为 ES5。

    对于其他一切,您应该使用polymer build 来提供 ES5 代码。如果需要,您可以提供服务。 (通过用户代理字符串检查服务器)

    【讨论】:

      猜你喜欢
      • 2015-12-18
      • 2021-01-09
      • 2011-09-15
      • 1970-01-01
      • 2021-01-04
      • 2023-03-29
      • 1970-01-01
      • 2019-06-07
      • 2019-09-13
      相关资源
      最近更新 更多