aspnetcore-angular-universal: Webpack / CLI errors while publishing

I’m getting the following output, any ideas? Its running just fine when I run the project, I just can’t publish it…

node node_modules/webpack/bin/webpack.js --env.aot --env.client
Running build for client with AoT Compilation
Hash: c57ee1028f0785bfc036
Version: webpack 2.2.1
Child
    Hash: c57ee1028f0785bfc036
    Time: 16464ms
                  Asset     Size  Chunks                    Chunk Names
        main-browser.js  1.15 MB       0  [emitted]  [big]  main-browser
    main-browser.js.map  1.42 MB       0  [emitted]         main-browser
       [0] ./~/rxjs/Observable.js 5.45 kB {0} [built]
      [28] (webpack)/buildin/global.js 509 bytes {0} [built]
      [29] ./~/@angular/core/@angular/core.es5.js 461 kB {0} [built]
      [46] ./~/rxjs/Subject.js 5.62 kB {0} [built]
      [53] ./Client/$$_gendir async 160 bytes {0} [built]
      [72] ./~/@angular/platform-browser/@angular/platform-browser.es5.js 142 kB {0} [built]
      [73] ./Client/polyfills/browser.polyfills.ts 128 bytes {0} [built]
      [74] ./~/@angular/common/@angular/common.es5.js 131 kB {0} [built]
      [75] ./Client/polyfills/polyfills.ts 1.2 kB {0} [built]
     [130] ./~/reflect-metadata/Reflect.js 48.2 kB {0} [built]
     [133] ./~/rxjs/SubjectSubscription.js 1.4 kB {0} [built]
     [160] ./~/rxjs/observable/merge.js 128 bytes {0} [built]
     [172] ./~/rxjs/operator/share.js 923 bytes {0} [built]
     [188] ./~/zone.js/dist/zone.js 96.1 kB {0} [built]
     [189] ./Client/main.browser.ts 1.04 kB {0} [built]
        + 175 hidden modules
    
    ERROR in Expected 'styles' to be an array of strings.
    
    ERROR in ./Client/main.browser.ts
Module not found(0,0): Error : Can't resolve './$$_gendir/app/browser-app.module.ngfactory' in 'D:\Users\dguisinger\git\ClientWebsite\Client'
     @ ./Client/main.browser.ts 4:0-89
D:\Users\dguisinger\git\ClientWebsite\ClientWebsite.csproj(96,5): Error MSB3073: The command "node node_modules/webpack/bin/webpack.js --env.aot --env.client" exited with code 2.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 28 (19 by maintainers)

Most upvoted comments

So there must of been errors during AoT compilation, but to me it looks like these caused errors:

https://github.com/MarkPieszak/aspnetcore-angular2-universal/blob/master/Client/app/containers/users/users.component.ts#L30-L31

You can’t use private properties or methods in a template, hence erroring the AoT compilation, causing this error of not finding NgModule. Not by a computer but can someone see if that fixes it?

Making them public fixed it!

I got 5 on April 19th to review… it’s something on that day, maybe long file names???

Is there anything special i should be searching for in my component style references? It’s just weird, I would have expected Webpack or Angular to encounter it already in normal project usage