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.

Cannot read property '0' of undefined

See original GitHub issue

when i type madge in windows command line

madge app.js

i get

at commonJSLookup (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\filing-cabinet\index.js:208:14)
    at jsLookup (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\filing-cabinet\index.js:154:14)
    at cabinet (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\filing-cabinet\index.js:62:18)
    at Function.module.exports._getDependencies (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:103:20)
    at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:147:37)
    at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
    at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
    at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
    at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)
    at traverse (C:\Users\username\AppData\Roaming\npm\node_modules\madge\node_modules\dependency-tree\index.js:173:20)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mrjoelkempcommented, Oct 11, 2018

Hey @techsin. Thanks for reporting the issue. Could you try a fresh install of madge and see if the problem persists? There was a bug fix to one of the dependencies pushed recently. I’m not sure that’ll fix the issue since versions have to match, but figured it would be worth trying in the meantime.

0reactions
mrjoelkempcommented, Oct 11, 2018

Woot. Glad to hear. https://github.com/dependents/node-detective-cjs/pull/9 was likely the fix. Enjoy!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read Property '0' of Undefined in JS
The "Cannot read property '0' of undefined" error occurs when trying to access the 0th index in a variable that stores an undefined...
Read more >
How To Fix Cannot read Property '0' of Undefined in JS
The Solution · Ensure you are using the correct variable · Perform a simple check on your variable before using it to make...
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
If a property of an object is an array, it's possible to accidentally misspell the key or try to access the array through...
Read more >
Javascript Uncaught TypeError: Cannot read property '0' of ...
You are passing the first item of words , instead of the array. Instead, pass the array to the function: hasLetter("a",words);.
Read more >
npm error cannot read property 0 of undefined
npm error cannot read property 0 of undefined · delete node_modules folder · delete package-lock.json · do “npm install” to recreate your node_modules...
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