【问题标题】:Getting a ScriptCompactor Error, failing to inline import a file收到 ScriptCompactor 错误,无法内联导入文件
【发布时间】:2016-09-08 14:31:09
【问题描述】:

我正在使用的应用程序曾经工作查找,我进行了 pub 升级,它坏了,所以我正在恢复过程中。我擦除了缓存,还原了应用程序,然后做了一个 pub get。

我注意到这个错误已经弹出并且未能得到解决。

[Error from ScriptCompactor on seg_ui|web/index.html]:
line 7, column 3 of web\index.html: Failed to inline HTML import: Could not find asset polymer_elements|lib/iron_flex_layout/classes/iron_flex_layout.html.
null
<link rel="import" href="packages/polymer_elements/iron_flex_layout/classes/iron_flex_layout.html">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Build completed with 1 errors.
[web] GET index.html => Could not find asset seg_ui|web/index.html.

我正在查看它所引用的文件 index.html,并按预期看到了该行。我试图评论它,但没有奏效。我删除了它以查看会发生什么,似乎我收到了一堆关于未找到一堆其他聚合物资产的警告。

例子:

[web] GET packages/polymer_elements/iron_resizable_behavior.dart => Could not find asset polymer_elements|lib/iron_resizable_behavior.dart.

[Warning from ImportInliner on seg_ui|web/index.html]:
line 10, column 1 of lib\components\dialog\dialog.html: Failed to inline HTML import: Could not find asset polymer_elements|lib/neon_animation/animations/slide_from_right_animation.html.
null
<link rel="import" href="../../../../packages/polymer_elements/neon_animation/animations/slide_from_right_animation.html">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

有人可以解释为什么会发生这种情况以及解决它的步骤吗?似乎由于某种原因,我的所有资产都没有被正确理解。

附带说明:当我去我的 pubspec 时,去获取所有内容都是最新的。如果我尝试修复,它似乎会修复,但少数文件具有HandshakeException: Connection terminated during Handshake.

【问题讨论】:

  • 您是否尝试删除项目目录中的.pub 目录?
  • 我实际上认为这是对 AppData pub 的引用。给我一秒钟,检查一下
  • .pubpub-cache 是两个不同的东西。清除 .pub 后,您需要再次运行 pub getpub upgrade
  • 宾果游戏!删除.pub,删除pub get,然后在浏览器中打开,现在可以使用了。

标签: dart polymer dart-polymer dart-pub


【解决方案1】:

pub upgrade 破坏应用程序时,通常是由项目的.pub 子目录中的无效缓存引起的。

删除此文件夹是安全的。之后再运行pub getpub upgrade

【讨论】:

    猜你喜欢
    • 2021-05-23
    • 1970-01-01
    • 2021-11-08
    • 2015-07-22
    • 2021-11-25
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 2013-02-12
    相关资源
    最近更新 更多