聚合物构建:警告 [unknown-superclass] - 无法解析超类 superClass

polymer build: Warning [unknown-superclass] - Unable to resolve superclass superClass

尝试构建我的 polymer 2.0 项目,但每次我尝试无论预设(es5-bundled、es6-bundled)还是单独的标志,我都会收到以下针对我拥有的一个 mixin 的警告:

EdmMac: public vedtam$ polymer build
info:    Clearing build/ directory...
info:    (default) Building...

    const DatastoreMixin = (superClass) => class extends superClass {
                                                         ~~~~~~~~~~
src/mixins/datastore-mixin.html(1,57) warning [unknown-superclass] - Unable to resolve superclass superClass
info:    (default) Build complete!

构建对象:

  "builds": [{
    "name": "default",
    "bundle": true,
    "js": {"compile": true},
    "css": {"minify": true},
    "html": {"minify": true},
    "addServiceWorker": true
  }]

来电者:app-main.html:

class MyApp extends Polymer.GestureEventListeners(DatastoreMixin(ReduxMixin(Polymer.Element))) {

DatastoreMixin:

<script>
    DatastoreMixin = function(superClass) {
      return class extends superClass {
        constructor() {
          super();
        }

        static get properties() {
          return {
            bar: {
              type: Object
            }
          };
        }

      }
    }
</script>

版本与环境

有什么问题吗?

这是我的代码,我没有收到任何我知道的警告 :p

const GrainUpdateInlineStyleBehavior = subclass => class extends subclass {

如果有人遇到同样的问题,我从 Polymer 开发人员那里得到了答案,作为修复你需要使用 /* @polymerMixin */ 注释:

<script>
    /* @polymerMixin */
    DatastoreMixin = function(superClass) {
      return class extends superClass {
        constructor() {
          super();
        }

        static get properties() {
          return {
            bar: {
              type: Object
            }
          };
        }

      }
    }
</script>