Skip to content
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

Throws exception in REPL #16

Open
apeace opened this issue Jun 21, 2016 · 0 comments
Open

Throws exception in REPL #16

apeace opened this issue Jun 21, 2016 · 0 comments

Comments

@apeace
Copy link

apeace commented Jun 21, 2016

To reproduce, create this test script test.js

var logger = require('nlogger').logger(module);

When you run node test.js it works fine.

But if you require the module from REPL you get:

$ node
> var test = require('./test');
TypeError: Cannot read property 'filename' of undefined
    at getClass (/Users/apeace/test/node_modules/nlogger/lib/nlogger.js:71:52)
    at Object.exports.logger (/Users/apeace/test/node_modules/nlogger/lib/nlogger.js:116:27)
    at Object.<anonymous> (/Users/apeace/test/test.js:1:95)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)

Here are my node and npm versions:

$ node --version
v6.0.0
$ npm --version
3.8.6
apeace added a commit to apeace/nlogger that referenced this issue Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant