I updated my app to angular 15 (15.2.0) but I got an error when I run karma test with npm run test :
The error is caused by Error: Automatic publicPath is not supported in this browser
. It only occurs when I run test, that works well when I build my project or I serve it.
I notice that this error appears only when I have stylePreprocessorOptions
on my test builder options :
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "packages/mypackage/src/test.ts",
"tsConfig": "packages/mypackage/tsconfig.spec.json",
"karmaConfig": "packages/mypackage/karma.conf.js",
// This option
"stylePreprocessorOptions": {
"includePaths": ["./node_modules/@mystylepackage"]
}
}
},
Complement:
- no specific webpack config file
- webpack version 5.75.0 (version installed with angular 15)
- karma packages versions:
"karma": "^6.4.0",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage": "^2.2.0",
"karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
I have no idea why, could you help me please ?
EDIT:
The error is from a home dependency with a wrong webpack config. After updating this dependency, it works well.