In Windows environment, using VS2017, I can run this fine. However, when I do a dotnet publish, it errors with the following:
error MSB3073: The command "node node_modules/webpack/bin/webpack.js --env.aot --env.client" exited with code 2.
Do you have the latest code as of yesterday by any chance?
https://github.com/MarkPieszak/aspnetcore-angular2-universal/issues/220#issuecomment-297534949
See if your users component has those private properties (they can't be)
Regarding Mark's comment above, one thing I learnt while working through the exercise with Mark the other day was that when you receive the error you're receiving you should look in the Output window and fix any "publish" errors you might see. Don't forget that "running" your app will not produce all the errors unless you visit the component in error whereas "publishing" your app _runs_ all areas of your app due in part to AoT. I hope that communicates and helps.
Mark, may I update the FAQ section with something such as the above? Perhaps... Why can I run my app but it publishes with error "The command 'node node_modules/webpack/bin/webpack.js --env.aot --env.client' exited with code 2."? I think this might be a common situation while ones developing these kinds of applications, or perhaps (even better) there's someway to redirect the output to the error window (or even adding a comment to the error window saying look in the output window)???
I'm not sure how we could output the error window somewhere else, I wish we could that'd be so helpful!
Yeah of course Tim, any faq info will help people tremendously, there's so much more I'd love to add.
Hoping to start a video series & blog posts about things in a month or so as well.
I've been thinking (dangerous, some people tell me :-))... One thing that we might want to show case that's fairly common is, in and around, authentication. I'm working on integrating authentication into my project (which uses this codebase) as we speak - using JWT and openiddict. Might retrofit in your solution with your permission/blessing and once I get it working, lol.
That was it. I fixed the errors and it publishes fine now. Thanks for the tip on where to find them.
I have the same problem. how you fix the error?
Can you check your console when you run npm run build:prod and see which AoT / other errors come up? There must be some issues there. Hope that helps! @hesampour
thank MarkPieszak. The problem was with modals. I removed the ngx bootstrap modal and everything is fine now.
Most helpful comment
Regarding Mark's comment above, one thing I learnt while working through the exercise with Mark the other day was that when you receive the error you're receiving you should look in the Output window and fix any "publish" errors you might see. Don't forget that "running" your app will not produce all the errors unless you visit the component in error whereas "publishing" your app _runs_ all areas of your app due in part to AoT. I hope that communicates and helps.