-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ng test not working with Node version 18.18.2 . Error " Cannot read properties of undefined (reading 'range') " #3868
Comments
I'm on the same boat, Angular 9, Node 16, Karma 6.4. Since using Node 16 (from using 14), npm is just giving me endless headaches... node-sass, karma, other legacy libraries... Every resource I found is saying to downgrade Node to v14, which I know worked for us before with Karma 4.3. Our project is too big to upgrade from Angular 9 to the latest version in a short time, I'm just wondering if there's a solution to this... |
Same I just migrated from Angular v14 to v15 with node v16.20.2 and Karma 6.4 and have the same issue. The only way I could advance is to remove all the Karma is deprecated so maybe moving from Karma to Jest is the way to go to lose less time |
Another possible solution is to install node14.1.(karma plugins break from node14.2 and later) |
Following is the content of my package.json file
Angular version
"@angular/animations": "^8.2.14",
"@angular/cdk": "^7.3.7",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular-devkit/build-angular": "^0.803.24",
"@angular/cli": "^8.3.29",
"@angular/compiler-cli": "^8.2.14",
Karma Jasmine versions
"jasmine-core": "^5.1.1",
"jasmine-reporters": "^2.5.2",
"jasmine-spec-reporter": "~4.2.1",
"jasmine-trx-reporter": "^2.3.0",
"json-logic-js": "^2.0.2",
"karma-chrome-launcher": "^3.2.0",
"karma": "^6.4.2",
"karma-cli": "^2.0.0",
"karma-coverage": "^2.2.1",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^1.5.3",
"karma-phantomjs-launcher": "^1.0.4",
Node version 18.18.2
Getting following issue while running 'ng test'
19 10 2023 14:29:04.084:ERROR [karma-server]: UnhandledRejection: TypeError: Cannot read properties of undefined (reading 'range')
at handleRangeHeaders (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\webpack-dev-middleware\lib\util.js:131:21)
at processRequest (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\webpack-dev-middleware\lib\middleware.js:98:19)
at ready (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\webpack-dev-middleware\lib\util.js:53:12)
at handleRequest (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\webpack-dev-middleware\lib\util.js:182:5)
at C:\Projects\CentricityNow\patient-viewer-ui\node_modules\webpack-dev-middleware\lib\middleware.js:64:7
at new Promise ()
at middleware (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\webpack-dev-middleware\lib\middleware.js:63:12)
at C:\Projects\CentricityNow\patient-viewer-ui\node_modules@angular-devkit\build-angular\src\angular-cli-files\plugins\karma.js:270:13
at call (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\connect\index.js:239:7)
at next (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\connect\index.js:183:5)
at C:\Projects\CentricityNow\patient-viewer-ui\node_modules\karma\lib\web-server.js:32:9
at call (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\connect\index.js:239:7)
at next (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\connect\index.js:183:5)
at createProxy (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\karma\lib\middleware\proxy.js:98:14)
at call (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\connect\index.js:239:7)
at next (C:\Projects\CentricityNow\patient-viewer-ui\node_modules\connect\index.js:183:5)
at C:\Projects\CentricityNow\patient-viewer-ui\node_modules\karma\lib\middleware\source_files.js:55:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Complete package.json file is below
package.json
content of karma.config.js fle is below :
karma config file.txt
I have gone through following issues
#3570
#3571
#3588
Please help me resolve the issue
The text was updated successfully, but these errors were encountered: