Skip to content
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

Karma test cases breaking in node 15.1 #3571

Closed
PPInfy opened this issue Nov 12, 2020 · 14 comments
Closed

Karma test cases breaking in node 15.1 #3571

PPInfy opened this issue Nov 12, 2020 · 14 comments

Comments

@PPInfy
Copy link

PPInfy commented Nov 12, 2020

Hi Team,

I have node 15.1 and node 10.x. The same Karma with Angular 9 Tests work fine in node 10.x. But when it is used with node 15.1 we are getting the following error and the test breaks abruptly. There is no pattern other than the below error.

12 11 2020 12:19:28.046:ERROR [karma-server]: TypeError: Cannot read property 'range' of undefined
at handleRangeHeaders (\webpack-dev-middleware\lib\util.js:131:21)
at processRequest (\webpack-dev-middleware\lib\middleware.js:98:19)
at ready (\webpack-dev-middleware\lib\util.js:53:12)
at handleRequest (\webpack-dev-middleware\lib\util.js:182:5)
at \webpack-dev-middleware\lib\middleware.js:64:7
at new Promise ()
at middleware (\webpack-dev-middleware\lib\middleware.js:63:12)
at @angular-devkit\build-angular\src\angular-cli-files\plugins\karma.js:270:13
at call (\connect\index.js:239:7)
at next (\connect\index.js:183:5)
at \karma\lib\web-server.js:24:9
at call (\connect\index.js:239:7)
at next (\connect\index.js:183:5)
at nullProxy (\karma\lib\middleware\proxy.js:80:52)
at call (\connect\index.js:239:7)
at next (\connect\index.js:183:5)

@ekdev2
Copy link

ekdev2 commented Nov 12, 2020

Our issues are related I think.
#3570

@PPInfy
Copy link
Author

PPInfy commented Nov 12, 2020

Ya maybe @ekdev2 . But our tickets have a different error trace.

@Glassig
Copy link

Glassig commented Nov 16, 2020

I use node 15.2.0, and karma 5.2.3, and I also get this error. It showed up recently.

@Glassig
Copy link

Glassig commented Nov 16, 2020

Downgrading node to v 14.15.1 works

@johnjbarton
Copy link
Contributor

We only support LTS versions. Also the call stack points to webpack. Maybe add some logging to narrow down the issue.

@thomasturrell
Copy link

@johnjbarton I see the same error on node 14.15.2.

@yktoo
Copy link

yktoo commented Dec 16, 2020

Amazing, a minor Node update that broke all tests.

For those running Debian/Ubuntu, I've fixed that by uninstalling nodejs, downloading nodejs_14.15.1-deb-1nodesource1_amd64.deb from nodesource pool and installing it with sudo dpkg -i ....

@johnjbarton
Copy link
Contributor

If you have a problem on node v14, please open a issue. This issue is about v15 which we do not support.

@sachin1989solanki
Copy link

Hi @johnjbarton I am facing same problem with node v14.15.2.
17 12 2020 07:18:56.924:ERROR [karma-server]: TypeError: Cannot read property 'range' of undefined
Its working fine with our previous node v14.15.1.

Please provide us solution as soon possible.

@Mayur123-mg
Copy link

Hi @johnjbarton I am facing same problem with node v14.15.2.
17 12 2020 07:18:56.924:ERROR [karma-server]: TypeError: Cannot read property 'range' of undefined
Its working fine with our previous node v14.15.1.

Please provide us solution as soon possible.

i also get same issue docker pipeline get error in ng test command

@johnjbarton
Copy link
Contributor

Please do not comment on this bug unless your comment is about node 15. We don't support v15 so we don't plan to reopen this bug.

If you have a problem with v14, please open an issue.

There is a bug in node v14.15.2 that impacts webpack, #3588

@nvahalik
Copy link

nvahalik commented Jan 8, 2021

Node v14 isn't supported on Apple Silicon.
Therefore, you cannot (currently) run karma on Apple Silicon machines.

Edit: Err, at least natively. If you follow the instructions here: https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr, you can run Node v14 via Rosetta and karma will run just fine:

  1. Install rosetta /usr/sbin/softwareupdate --install-rosetta --agree-to-license
  2. Install brew arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  3. (Note that brew for x86_64 installs to /usr/local/ rather than /opt/homebrew when running natively on Apple Silicon).
  4. Install node: arch -x86_64 brew install node@14
  5. (In my case, with angular) install the Angular CLI: /usr/local/bin/npm i -g @angular/cli
  6. Now, run the test runner from the node 14 version: /usr/local/bin/ng test

@AllForNothing
Copy link

@nvahalik I'm using an M1 mac book, and it works for me! Thanks!!

@rp1192kr
Copy link

I am getting below error while running npm run test:
26 07 2022 14:02:53.542:ERROR [karma-server]: UnhandledRejection
Cannot read properties of undefined (reading 'success')
TypeError: Cannot read properties of undefined (reading 'success')
at TestCommand.runSingleTarget (C:\Users\ttc2563\ngpp-clustering-ui\node_modules@angular\cli\models\packages\angular\cli\models\architect-command.ts:242:21)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at TestCommand.runArchitectTarget (C:\Users\ttc2563\ngpp-clustering-ui\node_modules@angular\cli\models\packages\angular\cli\models\architect-command.ts:263:16)
at TestCommand.validateAndRun (C:\Users\ttc2563\ngpp-clustering-ui\node_modules@angular\cli\models\packages\angular\cli\models\command.ts:163:14)
at Object.runCommand (C:\Users\ttc2563\ngpp-clustering-ui\node_modules@angular\cli\models\packages\angular\cli\models\command-runner.ts:189:12)
at default_1 (C:\Users\ttc2563\ngpp-clustering-ui\node_modules@angular\cli\lib\cli\packages\angular\cli\lib\cli\index.ts:32:27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests