Open mulmulovich opened 6 years ago
@mulmulovich are you trying to run this locally in your dev environment or on a remote CI environment? I'm able to run locally with no problem. You really only need the CHROME_BIN
environment variable if you're running on a remote CI system (unless you have Chrome installed in some weird place on your local system).
Update to latest version. It worked for me on version 2.2.
thanks m-spyratos, latest version of what?
Latest version of karma-chrome-launcher
. I was having the same issue on v2.0.0
. Upgrading to v2.2.0
fixed it. I would also suggest to upgrade karma
as well to latest version.
hi, i installed the latest karma-chrome-launcher since i posted the issue.. currently the tests fails imidiatly with this error:
HeadlessChrome 0.0.0 (Windows 7 0.0.0) ERROR
{
"message": "Uncaught TypeError: inherits is not a function\nat C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:144717:1\n\nTypeError: inherits is not a function\n at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/extensions/position_tracking/preprocessor_mixin.js.../../utils/mixin (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:144717:1)\n at require (C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:17:25)\n at C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:18:24\n at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/extensions/location_info/tokenizer_mixin.js.util (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:148885:41)\n at require (C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:17:25)\n at C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:18:24\n
at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/extensions/location_info/parser_mixin.js../tokenizer_mixin (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:145849:34)\n at require (C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:17:25)\n at C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:18:24\n at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/parser/index.js.../tree_adapters/default (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:146065:31)",
"str": "Uncaught TypeError: inherits is not a function\nat C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:144717:1\n\nTypeError: inherits is not a function\n at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/extensions/position_tracking/preprocessor_mixin.js.../../utils/mixin (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:144717:1)\n at require (C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:17:25)\n at C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:18:24\n at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/extensions/location_info/tokenizer_mixin.js.util (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:148885:41)\n at require (C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:17:25)\n at C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:18:24\n at
Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/extensions/location_info/parser_mixin.js../tokenizer_mixin (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:145849:34)\n at require (C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:17:25)\n at C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/karma-typescript/src/client/commonjs.js:18:24\n at Object.global.wrappers.C:/mulib_workspaces/Optima/ui/FE/Core/node_modules/parse5/lib/parser/index.js.../tree_adapters/default (C:/Users/mulib/AppData/Local/Temp/karma-typescript-bundle-13864XK6RZttxc4ab.js:146065:31)"
}
it's probably not related to the launcher anymore but to karma-typescript... any idea why its happens?
~Tip for others... I missed something obvious first time I saw this thread. If you previously had no plugins
entry you'll need to add a plugins
entry with 'karma-chrome-launcher'
in the list. (I'm maintaining an existing project, & I'm new to Karma, so I missed this.) But, now you're overriding plugins
, and you might lose some plugins. I used trial and error to find out my complete list.~
If you have a plugins
list you need to make sure to add 'karma-chrome-launcher'
, but I guess also Karma should be auto-adding some. Reference: http://karma-runner.github.io/2.0/config/plugins.html
Not sure what I'm doing wrong but figured I should clarify my bad comment!
I am getting same error with version 2.2.0 of 'karma-chrome-launcher'
. Any solutions?
I ran into this, but my karma-chrome-launcher
was way outdated, v0.2.2. After I updated to latest, (v2.2.0) it worked fine.
I am getting same error with version 2.2.0 of
'karma-chrome-launcher'
. Any solutions?
Same with me.
Any updates on that error?
I ran into this, but my
karma-chrome-launcher
was way outdated, v0.2.2. After I updated to latest, (v2.2.0) it worked fine.
Oh, wow, my eyes glazed over the 0.2.2 -> 2.2.0 distinction; thanks for pointing it out!
Any updates on that error?
Any update please? I am running into the same error while using circle ci with github to run continuous integration
FWIW, I had the same problem but my issue was that the path I had for my Karma.config.js in my angular.json file was incorrect. Karma still ran when I ran ng test because (as per Angualr.io)
The karma.conf.js file is a partial Karma configuration file. The CLI constructs the full runtime configuration in memory, based on application structure specified in the angular.json file, supplemented by karma.conf.js.
The error I was getting about my customLoader being missing is technically correct since Karma was not loading my config. So if the Karma config file specified in the angular.json file is not found, the CLI continues and makes a "default" config for Karma to run. This default does not know about any customLoaders.
My two cents: there should be some error outputted to the console that the specified karma config could not be found, but alas, there is not. Check your paths people!
Hope this helps someone.
Expected behaviour
after update of typescript, webpack, removing phantomJs and adding puppeteer tests will pass
Actual behaviour
when running tests, karma-launcher cannot load ChromeHeadless. and log this error:
Relevant part of your
karma.config.js
filetried to have plugins inside plugin section or remove plugins section altogether with no success.