2

I'm going through the Tour of Heroes tutorial on angular.io, and it appears that I need to restart the server in order to actually see my changes.

I created my project with @angular/cli@1.0.0-beta.32.3

My project's dependencies:

  "dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  },

npm list | grep webpack gives me:

│ ├─┬ @ngtools/webpack@1.2.10
│ ├─┬ extract-text-webpack-plugin@2.0.0
│ │ └── webpack-sources@0.1.4
│ ├─┬ html-webpack-plugin@2.28.0
│ ├─┬ karma-webpack@2.0.2
│ │ └── webpack-dev-middleware@1.10.1
│ ├─┬ webpack@2.2.1
│ ├─┬ webpack-dev-server@2.3.0
│ └── webpack-merge@2.6.1

I found this thread which suggests installing @ngtools/webpack@1.2.4, and I tried that, but it only resulted in more errors.

Community
  • 1
  • 1
Blaine Lafreniere
  • 3,451
  • 6
  • 33
  • 55

1 Answers1

1

Update to the latest version 1.0.0-rc.0 of the angular cli. The 32 version had several bugs. Make sure to follow their update and migration guide though, stated in their changelog and readme.md

Another thing that mysteriously worked for me, is to turn off safe write option inside intellij. But that of course only works if you use a jetbrains IDE :)

Poul Kruijt
  • 69,713
  • 12
  • 145
  • 149
  • Hrm, I updated to `@angular/cli@1.0.0-rc.0` and I have the same issue. I completely regenerated my project too. `node --version` says `v7.6.0`. – Blaine Lafreniere Mar 02 '17 at 05:14
  • So you removed your locale node_modules folder? Removed the global angular cli and reinstalled everything again? – Poul Kruijt Mar 02 '17 at 07:42
  • I didn't re-install `@angular/cli`, but I made sure it was up to date (`1.0.0-rc.0`), and then I obliterated my `tour-of-heroes` folder and re-created it with `ng new tour-of-heroes`. I've been working through the tutorial and this issue happens sporadically. Sometimes it updates, sometimes it doesn't, and when it doesn't, there isn't always indication as to why... I'll even open up the JavaScript console, and I won't see any indication of a problem whatsoever, even though it's very plain that my code has changed, and those changes are not appearing. I don't know what the problem is. – Blaine Lafreniere Mar 02 '17 at 07:54
  • One particular issue I'm seeing is... after adding `styles: \`...\`` to my @Component decorator, I'm not seeing them applied, no matter how many times I refresh, re-start the transpiler, etc. – Blaine Lafreniere Mar 02 '17 at 07:55
  • the right course of action is still to remove the global `@angular-cli`, run a `npm cache clean` and install it again. If that doesn't work, try the suggestion i put in my answer about intellij – Poul Kruijt Mar 02 '17 at 08:03