代码之家  ›  专栏  ›  技术社区  ›  tommueller

使用--prod标志时角度构建中断

  •  0
  • tommueller  · 技术社区  · 7 年前

    我使用Angular cli构建的Angular4运行正常,我可以启动应用程序,但许多组件无法正常加载。我的控制台中充满了以下错误消息:

    Expected function name "for", was ""
    Expected function name "keyFor", was ""
    Expected function name "next", was ""
    Expected function name "next", was ""
    Expected function name "clear", was ""
    Expected function name "delete", was ""
    Expected function name "entries", was ""
    Expected function name "forEach", was ""
    Expected function name "get", was ""
    Expected function name "has", was ""
    Expected function name "keys", was ""
    Expected function name "set", was ""
    Expected function name "values", was ""
    Expected function name "next", was ""
    Expected function name "add", was ""
    Expected function name "clear", was ""
    Expected function name "delete", was ""
    Expected function name "entries", was ""
    Expected function name "forEach", was ""
    Expected function name "has", was ""
    Expected function name "values", was ""
    Expected function name "next", was ""
    Expected function name "delete", was ""
    Expected function name "get", was ""
    Expected function name "has", was ""
    Expected function name "set", was ""
    Expected function name "add", was ""
    Expected function name "delete", was ""
    Expected function name "has", was ""
    Expected function name "all", was ""
    Expected function name "race", was ""
    Expected function name "reject", was ""
    Expected function name "resolve", was ""
    Expected function name "catch", was ""
    Expected function name "then", was ""
    

    有人知道从哪里开始追踪吗?

    1 回复  |  直到 7 年前
        1
  •  2
  •   tommueller    7 年前

    从我的 polyfills.ts

    然而,这并没有解决我应用程序中的错误。经过更多的测试,我发现问题在于使用 someObject.constructor.name === 'someString' 。angular cli编译器运行 丑八怪 type -field解决了我遇到的错误。另请参见: https://github.com/angular/angular-cli/issues/5168