Skip to content

ng build -prod and ng test --build false fails #1410

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
francisoud opened this issue Jul 21, 2016 · 4 comments
Closed

ng build -prod and ng test --build false fails #1410

francisoud opened this issue Jul 21, 2016 · 4 comments

Comments

@francisoud
Copy link

francisoud commented Jul 21, 2016

I run a CI tool with the following command to build the final product:
ng build -prod
ng test --build false --watch false

build: false => because I want the optimized version to be deployed
watch: false because of issue #977

Logs:

21 07 2016 10:57:45.266:WARN [web-server]: 404: /base/dist/vendor/@angular/core/testing.js
21 07 2016 10:57:45.267:WARN [web-server]: 404: /base/dist/vendor/@angular/platform-browser-dynamic/testing.js
Missing error handler on `socket`.

karma-test-shim.js lines 40 & 41 contains:
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')

But @angular is packaged in main.js with ng build -prod

Steps to reproduce

ng new myapp
myapp> npm install
myapp> ng build -prod
myapp> ng test --build false --watch false
Running without elevated rights. Running Ember CLI "as Administrator" increases performance significantly.
See ember-cli.com/user-guide/#windows for details.

21 07 2016 10:57:44.106:WARN [watcher]: Pattern "C:/tmp/myapp/dist/vendor/systemjs/dist/system-polyfills.js" does not match any file.
21 07 2016 10:57:44.108:WARN [watcher]: Pattern "C:/tmp/myapp/dist/vendor/zone.js/dist/async-test.js" does not match any file.
21 07 2016 10:57:44.110:WARN [watcher]: Pattern "C:/tmp/myapp/dist/vendor/zone.js/dist/fake-async-test.js" does not match any file.
21 07 2016 10:57:44.148:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
21 07 2016 10:57:44.160:INFO [launcher]: Starting browser Chrome
21 07 2016 10:57:45.128:INFO [Chrome 51.0.2704 (Windows 7 0.0.0)]: Connected on socket /#RXhnR8uuqkB_LPgFAAAA with id 34798801
21 07 2016 10:57:45.266:WARN [web-server]: 404: /base/dist/vendor/@angular/core/testing.js
21 07 2016 10:57:45.267:WARN [web-server]: 404: /base/dist/vendor/@angular/platform-browser-dynamic/testing.js
Missing error handler on `socket`.
TypeError: (msg || "").replace is not a function
    at C:\tmp\myapp\node_modules\karma\lib\reporter.js:45:23
    at onBrowserError (C:\tmp\myapp\node_modules\karma\lib\reporters\base.js:58:60)
    at .<anonymous> (C:\tmp\myapp\node_modules\karma\lib\events.js:13:22)
    at emitTwo (events.js:106:13)
    at emit (events.js:191:7)
    at onKarmaError (C:\tmp\myapp\node_modules\karma\lib\browser.js:95:13)
    at Socket.<anonymous> (C:\tmp\myapp\node_modules\karma\lib\events.js:13:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at Socket.onevent (C:\tmp\myapp\node_modules\karma\node_modules\socket.io\lib\socket.js:335:8)
    at Socket.onpacket (C:\tmp\myapp\node_modules\karma\node_modules\socket.io\lib\socket.js:295:12)
    at Client.ondecoded (C:\tmp\myapp\node_modules\karma\node_modules\socket.io\lib\client.js:193:14)
    at Decoder.Emitter.emit (C:\tmp\myapp\node_modules\karma\node_modules\socket.io\node_modules\socket.io-parser\node_modules\component-emitter\index.js:134:20)
    at Decoder.add (C:\tmp\myapp\node_modules\karma\node_modules\socket.io\node_modules\socket.io-parser\index.js:247:12)
    at Client.ondata (C:\tmp\myapp\node_modules\karma\node_modules\socket.io\lib\client.js:175:18)
    at emitOne (events.js:96:13)
21 07 2016 10:57:47.276:WARN [Chrome 51.0.2704 (Windows 7 0.0.0)]: Disconnected (1 times)
C:\tmp\myapp>tree dist
C:\TMP\MYAPP\DIST
├───app
└───vendor
    ├───es6-shim
    ├───reflect-metadata
    │   ├───test
    │   │   └───reflect
    │   └───typings
    ├───systemjs
    │   └───dist
    └───zone.js
        └───dist

Version

>ng --version
angular-cli: 1.0.0-beta.8
node: 6.2.1
os: win32 x64
@filipesilva
Copy link
Contributor

Closed as this issue was made obsolete by #1455.

@rukeshj
Copy link

rukeshj commented Oct 11, 2016

Hi @filipesilva and @francisoud , Sorry to ask question in the closed topic. I still face the same issue . My Karma window opens but I don't get the desired outcome.
Please find my output . Some help is really appreciated.

11 10 2016 17:09:28.897:INFO [karma]: Karma v1.3.0 server started at http://loca
lhost:9876/
11 10 2016 17:09:28.913:INFO [launcher]: Launching browser Chrome with unlimited
 concurrency
11 10 2016 17:09:28.959:INFO [launcher]: Starting browser Chrome
11 10 2016 17:09:35.287:INFO [Chrome 53.0.2785 (Windows 7 0.0.0)]: Connected on
socket /#8Q7ubFoB7Cb-ZE9fAAAA with id 48827969
11 10 2016 17:09:35.949:WARN [web-server]: 404: /base/node_modules/@angular/core
/testing.js
11 10 2016 17:09:35.958:WARN [web-server]: 404: /base/node_modules/@angular/plat
form-browser-dynamic/testing.js
Chrome 53.0.2785 (Windows 7 0.0.0) ERROR
  {
    "originalErr": {}
  }

Chrome 53.0.2785 (Windows 7 0.0.0) ERROR
  {
    "originalErr": {}
  }

@filipesilva
Copy link
Contributor

@rukeshj please open a new issue with a detailed description of the problem you face.

@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 6, 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

3 participants