-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Cannot read property 'filename' of undefined" on require('require-dir') #34
Comments
Hmm, that's indeed unexpected. Can you describe how you're running this? Also, |
Windows 8.1, Node v0.10.29, Require-Dir@0.3.0 |
How are you requiring it? |
var requireDir = require('require-dir'); It is breaking on that line. |
Any updates on this please? |
Sorry about that — I missed your earlier reply. Can you provide some more context? E.g. is this running in a file, or the REPL? Are you doing anything else with I'm definitely grasping at straws here, because I've never heard of this error before. And the Travis CI tests even cover Node 0.10, so it wouldn't be that. I don't know about Windows though... |
I am trying to write an app - so far it is very simple: just an app.js hooked to an index.html and inside the app.js I am requiring the package. As I said - the error is being thrown when requiring the package. Seems odd to me too - however I have no patches or overrides. |
Ah, you're running this browser-side? Let me know if I misunderstood. |
Also, if I misunderstood, it might be most helpful if you could just share a GitHub Gist or similar with your code. |
Hi @aseemk - thanks for that! Yes I was trying to use it from a browser. Thanks for your time. |
No problem! It might be possible to support the browser, but we can discuss that in issue #7. =) |
I am trying to get the requireDir by calling require('require-dir') and am getting the following error:
"Cannot read property 'filename' of undefined".
For some reason, my module.parent is always being undefined - hence the problem.
Am I trying to require requireDir in the wrong context?
The text was updated successfully, but these errors were encountered: