Skip to content

TypeScript changes not deployed, even though ng serve detects the changes #6744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
etovian opened this issue Jun 19, 2017 · 15 comments
Closed

Comments

@etovian
Copy link

etovian commented Jun 19, 2017

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.1.2
node: 6.10.0
os: win32 x64
@angular/animations: 4.2.3
@angular/common: 4.2.3
@angular/compiler: 4.2.3
@angular/core: 4.2.3
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.2.3
@angular/http: 4.2.3
@angular/material: 2.0.0-beta.7
@angular/platform-browser: 4.2.3
@angular/platform-browser-dynamic: 4.2.3
@angular/router: 4.2.3
@angular/cli: 1.1.2
@angular/compiler-cli: 4.2.3

Repro steps.

  1. Make a change to a TypeScript file
  2. Observe that webpack recompiles
  3. Observe that the browser refreshes
  4. Observe that the TypeScript changes were not deployed to the browser
  5. Make a change to an html template file
  6. Observe that the html changes have been deployed to the browser, but any TypeScript changes have not

No exceptions are thrown

Mention any other details that might be useful.

This was first reported against v1.0 (#5600) and closed as presumably fixed, but the issue persists.

IDE: IntelliJ
OS: Windows 10

@jongunter
Copy link

jongunter commented Jun 21, 2017

I have this exact problem, too. HTML gets changed, but TS does not. I Ctrl+C and ng serve again to make it pick up my changes. Sometimes, it works just fine and picks up my changes, though.

"@angular/animations": "^4.0.0",
 "@angular/common": "^4.0.0",
 "@angular/compiler": "^4.0.0",
 "@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0"
"@angular/cli": "1.1.2",
"@angular/compiler-cli": "^4.0.0",
``
IDE: WebStorm
OS: Windows 8

I have been experiencing this problem intermittently for a while now (even back in version 2).

@jongunter
Copy link

I'm not sure, but this seems to happen after very small changes (1-2 lines of code). Larger changes seem to get picked up. Also, my terminal shows that the CLI is recompiling after every change.

@ctrl-brk
Copy link

Sometimes happens to me too but only if I update an interface definition. All other changes are fine.

@jongunter
Copy link

I think this only happens on my Windows machine. Seems to be okay on MacOS. Can anyone confirm it's the same for them?

@etovian
Copy link
Author

etovian commented Jun 21, 2017

@jongunter Same here. Works fine on MacOS running @angular/cli version 1.0, but I haven't tried 1.1.2 on my Mac yet.

@etovian
Copy link
Author

etovian commented Jun 23, 2017

@jongunter Since most of my changes are small, I hadn't given it much thought, but you're definitely on to something. From a newly created app, I can change the title property in app.component.ts by adding several characters to the string, and the change is not recognized. However, if I add several hundred characters to the title property, it works as expected.

@krilllind
Copy link

Same here, all changes gets registered but I have to recompile two/three times to get the changes "live" in the browser. TS files only requires two compiles but HTML sometimes need three, and SCSS files only requires one compilation.

IDE: Visual Studio Code Version 1.13.1
OS: Win10 x64

dep:
"@angular/animations": "^4.1.3",
"@angular/common": "^4.1.3",
"@angular/compiler": "^4.1.3",
"@angular/core": "^4.1.3",
"@angular/forms": "^4.1.3",
"@angular/http": "^4.1.3",
"@angular/platform-browser": "^4.1.3",
"@angular/platform-browser-dynamic": "^4.1.3",
"@angular/router": "^4.1.3",
"bootstrap-sass": "^3.3.7",
....

devDep:
"@angular/cli": "^1.0.6",
"@angular/compiler-cli": "^4.1.3",
"@ngtools/webpack": "^1.3.1",
"@types/jasmine": "2.5.52",
"@types/node": "~8.0.0",
"@types/signalr": "^2.2.33",
"@types/gridstack": "^0.0.36",
"codelyzer": "~3.0.1",
"ts-node": "~3.0.6",
"tslint": "~5.4.3",
"typescript": "~2.3.4"

Running following command:
ng serve --aot --host 0.0.0.0 --port 3000 --proxy-config proxy.config.json

@krilllind
Copy link

@etovian Please check this issue #4394, have you tried to disable "safe write"?

@etovian
Copy link
Author

etovian commented Jun 26, 2017

@krilllind This seems to have solved the problem for me; thanks so much for the tip! I'm going to keep an eye on it for a bit to be sure, but I'll likely close the issue soon. For others who are using IntelliJ/WebStorm, here's how to disable safe write, as @krillind suggested. Thanks again!

@filipesilva
Copy link
Contributor

Heya, the main issue for these problems is #1610. As @krilllind mentioned, disabling safe write in your IDE should help.

@ghost
Copy link

ghost commented Aug 10, 2017

Sorry but I always read "disable this option in [your ide]". I use notepad++. So where can I find this option if there is no IDE? It worked fine with a2 and a2univeral. Why do I need an IDE now hack some code? @filipesilva

@cedx
Copy link

cedx commented May 22, 2019

Same issue here with Angular CLI 7.3.9 and Node.js 12.3.0 on Windows 10 and Ubuntu 19.04.
Even if I use the base Notepad from Winsdows (so there is no concept of safe write with this tool), TypeScript changes are never reflected, only HTML and CSS changes.

@mustafamg
Copy link

Same issue here with Angular CLI 7.3.9 and Node.js 12.3.0 on Windows 10 and Ubuntu 19.04.
Even if I use the base Notepad from Winsdows (so there is no concept of safe write with this tool), TypeScript changes are never reflected, only HTML and CSS changes.

Me too facing the same problem with windows 10 same cli version and node 10.16

@cedx
Copy link

cedx commented Jul 6, 2019

On my side, this issue was fixed after upgrading to Angular 8.1.0 👍

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants