小编Gar*_*nte的帖子

窗口未使用Angular4 + AoT + Webpack2定义

我有一个使用webpack的angular4应用程序,并且与JiT一起工作很好,但现在我正试图让它与AoT合作,我遇到了问题.具体来说,我收到以下错误:

ERROR in window is not defined

ERROR in ./src/app/main/main.ts
Module not found: Error: Can't resolve './../../../aot-main/src/app/main/app.module.ngfactory' in 'W:\<Full Path to App>\src\app\main'
resolve './../../../aot-main/src/app/main/app.module.ngfactory' in 'W:\<Full Path to App>\src\app\main'
  using description file: W:\<Full Path to App>\package.json (relative path: ./src/app/main)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: W:\<Full Path to App>\package.json (relative path: ./src/app/main)
    using description file: W:\<Full Path to App>\package.json (relative path: ./aot-main/src/app/main/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        W:\<Full Path …
Run Code Online (Sandbox Code Playgroud)

webpack-2 angular2-aot angular

5
推荐指数
1
解决办法
1041
查看次数

标签 统计

angular ×1

angular2-aot ×1

webpack-2 ×1