Created
August 15, 2012 22:31
-
-
Save mediaupstream/3364308 to your computer and use it in GitHub Desktop.
Recursive require crashes node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./index.js')(); | |
module.exports = function(){ | |
console.log('foo.js', Date.now() ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node --version | |
v0.6.2 | |
$ node index.js | |
node.js:201 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
TypeError: object is not a function | |
at Object.CALL_NON_FUNCTION (native) | |
at Object.<anonymous> (/fun/test/foo.js:1:83) | |
at Module._compile (module.js:432:26) | |
at Object..js (module.js:450:10) | |
at Module.load (module.js:351:31) | |
at Function._load (module.js:310:12) | |
at Module.require (module.js:357:17) | |
at require (module.js:368:17) | |
at Object.<anonymous> (/fun/test/index.js:1:63) | |
at Module._compile (module.js:432:26) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./foo.js')(); | |
module.exports = function(){ | |
console.log('index.js', Date.now()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment