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

Angular-cli & Webpack & ng test (msg || "").replace is not a function

Open Chabane opened this issue 10 years ago • 7 comments

Hi,

I have an error when I execute the command ng test. I tried to add -watch=false -build=false, it doesn't work.

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 7
  2. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here: angular-cli: 1.0.0-beta.11-webpack node: 6.3.1 os: win32 x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc. Migrating from angular-cli@broccoli
  4. The log given by the failure. Normally this include a stack trace and some more information. Missing error handler on socket. TypeError: (msg || "").replace is not a function
  5. Mention any other details that might be useful. Nop.

Thanks.

Chabane avatar Aug 09 '16 12:08 Chabane

I am having the same issue but only since updating to the newest build for rc5

deebloo avatar Aug 09 '16 21:08 deebloo

I'm having the same (and similar) issues after updating to RC5. In my case also, ALL tests cannot be compiled by Broccoli.

vapits avatar Aug 10 '16 09:08 vapits

If you upgrade to karma 1.0 or higher you will get a different error message. The one you are posting is a red-herring message caused by an issue in karma so it doesn't say much about the underlying issue.

westonpace avatar Aug 12 '16 17:08 westonpace

@Chabane I manage to fix it by upgrading to @webpack version and of course RC5,

vapits avatar Aug 12 '16 20:08 vapits

@Chabane If it is the same issue I was running into, the actual error message was only clear by checking the karma debugging button in chrome. screen shot 2016-08-13 at 11 41 52 am

I think this pull request should fix the issue for new projects and be easy to update in existing projects. https://github.com/angular/angular-cli/pull/1680

mhamel06 avatar Aug 13 '16 15:08 mhamel06

Fixed by https://github.com/angular/angular-cli/pull/1680.

filipesilva avatar Aug 19 '16 03:08 filipesilva

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.