question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'mtime' of undefined

See original GitHub issue

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.

/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/file-list.js:174
      var mtime = mg.statCache[path].mtime
                                    ^
TypeError: Cannot read property 'mtime' of undefined
  at /Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/file-list.js:174:37
  at Array.map (native)
  at Promise.all.cancellable.then.self.buckets (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/file-list.js:168:30)
  at Array.map (native)
  at [object Object].List._refresh (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/file-list.js:151:37)
  at [object Object].List.refresh (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/file-list.js:250:27)
  at [object Object].Server._start (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/server.js:168:12)
  at [object Object].invoke (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/node_modules/di/lib/injector.js:75:15)
  at [object Object].Server.start (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/server.js:92:18)
  at Object.exports.run (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/lib/cli.js:231:26)
  at Object.<anonymous> (/Users/Dimitri/.meteor/packages/sanjo_karma/.1.6.1.6961j1++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/karma/bin/karma:3:23)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:929:3

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
fbengridcommented, Aug 3, 2015

I had the same issue but solved it by changing all the file groups patterns ending from *.{a,b,c} to *.+(a|b|c)

1reaction
mikebellcodercommented, Jan 28, 2022

Just ran into this yesterday and comment from earlier fixed it for me. https://github.com/karma-runner/karma/issues/1532#issuecomment-127128326

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'mtime' of undefined
TypeError : Cannot read property 'mtime' of undefined.
Read more >
Tests fail after karma upgrade from 0.12 to 0.13 - Stack Overflow
Warning: Cannot read property 'mtime' of undefined Use --force to continue. Aborted due to warnings. My karma.conf.js is as below.
Read more >
TypeError: Cannot read property 'getTime' of Undefined in JS
The "Cannot read property 'getTime' of undefined" error occurs when the getTime() method is called on an undefined value. To solve the error,...
Read more >
File system | Node.js v19.3.0 Documentation
unwatchFile(filename[, listener]); fs.utimes(path, atime, mtime, callback) ... the mode cannot be changed from what it was set to with fsPromises.open() .
Read more >
Dataview plugin snippet showcase - Obsidian Forum
Evaluation Error: TypeError: Cannot read property 'isValid' of undefined at DateTime.equals (eval at (app://obsidian.md/app.js:1:1153594), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found