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

Build is not kicking off in a browser on save

Open kuncevic opened this issue 9 years ago • 81 comments

OS

Windows 10.

Versions.

angular-cli: 1.0.0-beta.28.3
node: 6.9.2
os: win32 x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/flex-layout: 2.0.0-beta.4
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5

Repro steps.

Migrate from beta.24 to beta.28.3 Modify any file Click save Chrome dev console saying:

[WDS] App updated. Recompiling...
[WDS] Nothing changed.

The new build is not kicking off

So had to stop and reastart ng serve manually

kuncevic avatar Feb 02 '17 04:02 kuncevic

@web-dave: tried your fix and now get the following on calling ng serve:

Cannot find module 'rxjs/symbol/observable' Error: Cannot find module 'rxjs/symbol/observable' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at globalScope (C:\Users\Media\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular\core\bundles\core.umd.js:7:85) at Object. (C:\Users\Media\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular\core\bundles\core.umd.js:10:2) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) ........ Output from ng v:

@angular/cli: 1.0.0-beta.30 node: 6.9.4 os: win32 x64 @angular/common: 2.4.6 @angular/compiler: 2.4.6 @angular/core: 2.4.6 @angular/forms: 2.4.6 @angular/http: 2.4.6 @angular/platform-browser: 2.4.6 @angular/platform-browser-dynamic: 2.4.6 @angular/router: 3.4.6 @angular/compiler-cli: 2.4.6 @ngtools/webpack: 1.2.4

MarkWilsoncom avatar Feb 03 '17 10:02 MarkWilsoncom

@MarkWilsoncom did you update your package.json with the modified name ? "angular-cli": "^1.0.0-beta.28.3", becomes "@angular/cli": "1.0.0-beta.30",

@raducostea "@angular/[email protected]" and @ngtools/[email protected] did not work for me (win 10 , node 6.9.5)

grunk avatar Feb 03 '17 10:02 grunk

"@ngtools/webpack": "1.2.4" worked here

cassmtnr avatar Feb 03 '17 10:02 cassmtnr

@grunk: no - good point. Just updated and still get the same error.

Dependencies in package.json:

"dependencies": { "@angular/common": "^2.3.1", "@angular/compiler": "^2.3.1", "@angular/core": "^2.3.1", "@angular/forms": "^2.3.1", "@angular/http": "^2.3.1", "@angular/platform-browser": "^2.3.1", "@angular/platform-browser-dynamic": "^2.3.1", "@angular/router": "^3.3.1", "@ngtools/webpack": "^1.2.4", "core-js": "^2.4.1", "rxjs": "^5.0.1", "ts-helpers": "^1.1.1", "zone.js": "^0.7.2" }, "devDependencies": { "@angular/compiler-cli": "^2.3.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "1.0.0-beta.30", "codelyzer": "~2.0.0-beta.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "~4.0.13", "ts-node": "1.2.1", "tslint": "^4.3.0", "typescript": "~2.0.3" }

Just trying to get a really basic example up and running...

MarkWilsoncom avatar Feb 03 '17 10:02 MarkWilsoncom

@MarkWilsoncom npm uninstall angular-cli --save npm install @angular/cli@lastest --save npm install @ngtools/[email protected] --save

This worked for me.

raducostea avatar Feb 03 '17 11:02 raducostea

Make sure you delete your node_modules folder within your projects also, this step is often overlooked.

RicardoVaranda avatar Feb 03 '17 11:02 RicardoVaranda

@MarkWilsoncom "angular-cli": "1.0.0-beta.30", should be "@angular/cli": "1.0.0-beta.30", in your package.json then try rimraf node_modules and npm install

kuncevic avatar Feb 03 '17 11:02 kuncevic

@raducostea : thx - works! @kuncevic: hmm - only thing I thought manually changed was "30"... thx anyway

Just getting started with angular 2 - great to see a helpful and responsive community - thx people :-)

MarkWilsoncom avatar Feb 03 '17 11:02 MarkWilsoncom

It need to be "@ngtools/webpack": "1.2.4" at package.json and NOT "@ngtools/webpack": "^1.2.4"

cassmtnr avatar Feb 03 '17 13:02 cassmtnr

package.json temporary fix for beta.30

"devDependencies": { "@angular/cli": "1.0.0-beta.30", ... "@ngtools/webpack" : "1.2.4" }

Looks like something is broken after 1.2.4

emazv72 avatar Feb 03 '17 13:02 emazv72

Downgrading @ngtools/webpack to 1.2.4 works for me as well.

Windows 10, node 6.9.4, beta30

rkajbaf avatar Feb 03 '17 18:02 rkajbaf

beside all the error confimations. Compiling is damn fast!!! 💋

web-dave avatar Feb 03 '17 19:02 web-dave

@web-dave Maybe it is damn fast because it does not compile any typescript ;-)

JiriBalcar avatar Feb 03 '17 19:02 JiriBalcar

i mean with the fixed compiling!! (@ngTools/[email protected])

web-dave avatar Feb 03 '17 19:02 web-dave

Yes but with @ngtools/[email protected] the lazyloaded bundles are not generated if you use import * as somewhere in your code (even in node_modules).

JiriBalcar avatar Feb 03 '17 19:02 JiriBalcar

I haven't noticed any significant speed increase.

ctrl-brk avatar Feb 04 '17 00:02 ctrl-brk

I can see an about 2s improvement. I get a 2-3 seconds build time on save. Previously i was getting 4-5 seconds before.

raducostea avatar Feb 05 '17 14:02 raducostea

When will there be a release? Im waiting for this every day :)

MickL avatar Feb 06 '17 11:02 MickL

This was already fixed for me in the latest @angular/cli

raducostea avatar Feb 06 '17 11:02 raducostea

In beta 30? I didn't see it in the changelog tho.

MickL avatar Feb 06 '17 12:02 MickL