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

Closed
isaacs opened this Issue Feb 21, 2011 · 1 comment

Projects

None yet

2 participants

@isaacs
Collaborator
isaacs commented Feb 21, 2011

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.

@felixge
felixge commented Feb 25, 2011

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

@coolaj86 coolaj86 pushed a commit that referenced this issue Apr 15, 2011
@felixge felixge 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