Skip to content
This repository

require() in the repl that throws is somehow hidden #707

Closed
isaacs opened this Issue February 20, 2011 · 1 comment

2 participants

Isaac Z. Schlueter Felix Geisendörfer
Isaac Z. Schlueter
Collaborator

Not sure why this is happening.

npm install dnode
node
> require("dnode")
{}

This should throw, because "lazy" doesn't have a main field, and thus can't be loaded. However, the error is swallowed. Really strange.

Pattern: m1 -> m2 -> m3. m3 isn't found. in the repl, require('m1'), and get {}, and no error. It even shows up in require.cache with an empty exports. Really weird.

Felix Geisendörfer
Collaborator

Do not cache modules that throw exceptions

If a module throws an exception on load, it should not be cached.
This patch shows the problem in a test case and also fixes it.

See: https://groups.google.com/forum/#!topic/nodejs-dev/1cIrvJcADbY

Closed by 66601f1
Closed by 66601f1

AJ ONeal coolaj86 referenced this issue from a commit February 21, 2011
Felix Geisendörfer Do not cache modules that throw exceptions
If a module throws an exception on load, it should not be cached.
This patch shows the problem in a test case and also fixes it.

See: https://groups.google.com/forum/#!topic/nodejs-dev/1cIrvJcADbY

Closes GH-707
Closes GH-710
66601f1
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.