Skip to content

Cannot read property '.js' of undefined #1

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

Open
dimanchee opened this issue Mar 13, 2015 · 1 comment
Open

Cannot read property '.js' of undefined #1

dimanchee opened this issue Mar 13, 2015 · 1 comment

Comments

@dimanchee
Copy link

Hi,

I am trying to hook a function in node module, but I got error as mentioned in the title, below is my code:

var hook = require('node-hook');
function Request(method, url) {
alert(url);
}
hook.hook('.js', Request);
require('./node_modules/module_name/index');

Is it possible on the way I am trying to archive?

@bahmutov
Copy link
Owner

Could you return the source after printing the filename? See the same example working in https://github.com/bahmutov/node-hook/blob/master/test/use-case.js

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

2 participants