Open ghost opened 9 years ago
I had the same issue but solved it by changing all the file groups patterns ending from
*.{a,b,c}
to *.+(a|b|c)
Ok, thanks. :+1: I will do that.
Interesting, that this happens on non windows systems as well, this is mainly due to an issue in node-glob. Will have to do more digging. Thanks for the report
One of my package users reported that changing the glob patterns from *.{a,b,c}
to *.+(a|b|c)
fixed the problem as @fbengrid pointed out.
+1 for @fbengrid's workaround (i'm on a mac)
Error snippet:
/path/to/node_modules/karma/lib/file-list.js:174
var mtime = mg.statCache[path].mtime
^
TypeError: Cannot read property 'mtime' of undefined
...
My Env:
$sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.4
BuildVersion: 14E46
$node_modules/.bin/karma --version
Karma version: 0.13.4
karma-jasmine: 0.3.6
karma-phantomjs-launcher: 0.2.0
+1 I have this issue fairly regularly on Ubuntu 14.04, using PyCharm 4.5 and the latest Karma plugin. karma package version 0.12.37:
ERROR [karma]: [TypeError: Cannot read property 'mtime' of undefined]
TypeError: Cannot read property 'mtime' of undefined
at /mnt/colbblailx.old/home/colbblai/src/sel2730S/nucleus/core/omni/SettingsClasses/list/node_modules/karma/lib/file_list.js:317:31
at Object.oncomplete (fs.js:108:15)
Haven't found what causes it exactly, happens intermittently. I do get errors just before it, which may be related. But again are related to something the karma runner is doing with .ktp.ts files, not sure why they're failing:
INFO [watcher]: Removed file "/.../src/cert.ts.ktp.ts".
WARN [watcher]: { [Error: ENOENT, stat '/.../src/cert.ts.ktp.ts']
errno: 34,
code: 'ENOENT',
path: '/.../src/cert.ts.ktp.ts' }
Error: ENOENT, stat '/.../src/cert.ts.ktp.ts'
I'm having this same issue and I can't find where to change the glob patterns. I'm on OS X Yosemite.
node version 0.12.1 karma version 0.13.9
It may be of interest to note that on one of the projects I'm working on, we had a dev perform the workaround mentioned by @fbengrid , which subsequently resulted in a WARN [watcher]: Pattern "C:/Users/username/project/src/main/webapp/scripts/components/**/*.{js|html}" does not match any file.
message and an entire suite of broken tests on my Windows box due to the angular injector not having the required files.
You might want to verify that the fix works cross-platform before patching in the suggested workaround.
I'm using: Windows 10 Node 0.12.7 Karma 0.12.35
Thank you @fbengrid.
@shawmanz32na I do work mainly with windows environment (for the dev phase at least) but not on windows 10.
Just to be sure looking at the pattern you wrote and the one I was referring to for the "glob" to work on karma 0.13.x, it must use parenthesis not accolades: so *.+(js|html)
and not *.{js|html}
Using accolades will not work for recent version of karma (last I worked with was 0.13.9).
@donaldpipowitch you're welcome, but it's the authors of this library who deserve our thanks for this great tool. :)
@fbengrid We changed our glob pattern to *.+(js|html)
and all is well. Thanks for the clarification. We missed the part about changing the accolades to parens the first time around.
Which conf file you referring? Can you paste the example please ?
the configuration file referred to is the one presented on http://karma-runner.github.io/0.13/config/configuration-file.html
and the patterns is the one used for the File
attribute.
Just ran into this yesterday and comment from earlier fixed it for me. https://github.com/karma-runner/karma/issues/1532#issuecomment-127128326
Hi, my users get this error on Mac OS X with Karma 0.13.2. It's this line: https://github.com/karma-runner/karma/blob/v0.13.2/lib/file-list.js#L174 where
mg.statCache[path]
is undefined. Here is the Karma config that is used https://gist.github.com/Sanjo/fde7bf14768d6baf16e6.Maybe related to https://github.com/karma-runner/karma/issues/1494.