【问题标题】:Which way to go with these bugs解决这些错误的方法
【发布时间】:2014-03-22 15:34:46
【问题描述】:

Compiling Dart app to js 出现这两个错误:

Nº1:

InvalidStateError: Failed to call 'register' on 'Document' for type 'polymer-element': a type with that name is already registered.

Nº2:

Breaking on exception: TypeError: Object #<qE> has no method 'vL'

对象 qE 由 dart2js 创建。 如何找到解决方案? 有合适的工具来寻找解决方案吗? 感谢您的提前!

【问题讨论】:

    标签: dart dart-polymer dart2js


    【解决方案1】:

    我听说在同一个应用程序中使用 Angular 和 Polymer 时会发生 N1。这是一个已知的错误。

    相关的未解决问题:
    - duplicate polymer-element registration should not break the app
    - Get error "Uncaught InvalidStateError: Failed to call 'register' on 'Document' for type 'polymer-element'

    对于 N2,请使用 pub build --mode=debug,以便您获得未损坏的名称,然后使用一种可用的策略来解决问题(使用 MirrorsUsed、@observable、@reflectable)

    【讨论】:

    • 嗨,我只使用 Polymer。
    • 你是在 Dart 代码中注册你的组件还是只在 HTML 中导入?或者你有重复的@CustomTag() 注释?但我想它也不会在 Dartium 中运行。
    • 在类定义(文件.dart)中,在类dart之前,写@CustomTag(),在html中只有聚合物元素定义、名称、模板标签等...
    • 我自己还没有遇到这个问题,只是阅读了其他人的问题。我不知道可能是什么原因。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 2014-02-19
    • 1970-01-01
    • 2023-02-24
    • 1970-01-01
    相关资源
    最近更新 更多