Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Strange error when loading an empty file #1448
While this is likely a bit of an edge case, it threw me for a loop. If you attempt to load a module in Deno that is empty, you get a cryptic message with a stack trace that doesn't help you. It occured to me where I had stubbed out a test module and had added it to my main test module that imported this empty file.
For example, if you do the following:
It comes from here:
Which is an assertion that was a hold over from when we were really concerned about the internals of Deno working properly. I think it is actually legitimate to have an empty module (like when you are stubbing out stuff) and these should result in a no-op, like they would in any other runtime. So I would propose we remove this assertion, because it is actually valid and possible. If not, then we should at least log out the file that it came from so the user is more informed.