Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 not updating browser after changes

Tags:

angular

basically when I change something in my app, the console can detect the changes...

[0] 9:23:22 AM - File change detected. Starting incremental compilation...

[0] 9:23:23 AM - Compilation complete. Watching for file changes.

[1] [BS] File changed: app/components/logo/logo.component.js

[1] [BS] File changed: app/components/navBar/navbar.component.js

[1] [BS] File changed: app/components/sideBar/sidebar.component.js

...

But it's no longer updating my web browser automatically (screen going white with the "Loading..." message :( I've no idea why.

Here is my package.json

{
  "name": "room",
  "version": "1.0.0",
  "scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\"  ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install",
"build-master-sass": "node-sass -w style.scss style.css",
"build-children-sass": "node-sass -w -r app/css -o app/css",
"lint" : "tslint app/**/*.ts"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.7",
"systemjs": "0.19.22",
"es6-promise": "^3.1.2",
"es6-shim": "^0.33.4",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.5.15",
"ng2-bootstrap": "1.0.5",
"bootstrap-material-design-icons" : "2.2.0"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.1.0",
"typescript": "^1.8.2",
"typings": "^0.6.8"
}
}

Any suggestions ?

like image 552
Marco Jr Avatar asked Nov 08 '22 18:11

Marco Jr


1 Answers

I am having a similiar issue (beta.11) (MAC / Chrome). Following the tutorials on Angular IO, files are being detected as changed and recompiles but browser is not refreshing. I have another project (template starter) beta.8 and it is working. As soon as I find out the differences, I will give you a heads up.

update: (things that make u go hummmm) After changing my package.json from angular2.beta.11 to (angular2.beta.8 or angular2.beta.9) I did a npm install then [npm start]- the browser sync started and updated by browser. [CTRL-C] to stop the watch then changed my package back to angular2.beta.11 did another [NPM INSTALL] and [NPM START] A new browser tab opened up but when I made a change it updated the other tab I started and stopped when i launched with beta.8/9. and not the Tab it launched. It appears Browsersync is not starting with beta.11 ?

like image 76
christianH Avatar answered Nov 15 '22 07:11

christianH