angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Prod build not loading (minification errors) in a clean project

Open HonnKing opened this issue 10 years ago • 3 comments

It seems like ng build -prod doesn't minify things correctly. I first had some issues with prod builds trying to load individual files in my app (and getting 404s), so in order to check if it's something I did or not I tried creating an empty project with a single route and building that, and promptly encountered an error preventing me from testing further.

  1. OS? El Capitan
  2. Versions angular-cli: 0.0.39 node: 4.1.2 os: darwin x64
  3. Repro steps ng new testapp cd testapp ng g route someroute ng build -prod Serve dist folder in whatever way (ng serve -prod, nginx, python server etc)
  4. The log given by the failure main.js:11 ORIGINAL EXCEPTION: No provider for a!b.logError @ main.js:11a.call @ main.js:21(anonymous function) @ main.js:18ZoneDelegate.invoke @ zone.js:323onInvoke @ main.js:17ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356onInvokeTask @ main.js:17ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426 main.js:11 ORIGINAL STACKTRACE:b.logError @ main.js:11a.call @ main.js:21(anonymous function) @ main.js:18ZoneDelegate.invoke @ zone.js:323onInvoke @ main.js:17ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356onInvokeTask @ main.js:17ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426 main.js:11 Error: DI Exception at b as constructor at b as constructor at new b (main.js:20) at a._throwOrNull (main.js:19) at a._getByKeyDefault (main.js:19) at a._getByKey (main.js:19) at a.get (main.js:19) at b.get (main.js:18) at b._View_a0.createInternal (a.template.js:24) at b.a.create (main.js:18)

HonnKing avatar Jun 29 '16 11:06 HonnKing

That's with the version I just got from npm, I'll try updating to the beta and see if that solves the issue.

HonnKing avatar Jun 29 '16 11:06 HonnKing

Can't use ng g route in the newest version, so I can't to the exact same test, but without that it works with beta 8.

HonnKing avatar Jun 29 '16 12:06 HonnKing

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.