-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
bug: type only files are not emitted #6746
Comments
There is no valid emit for Instead of "hacking around it" |
@kitsonk certainly there's nothing to emit as it's |
Because TypeScript doesn't know that at runtime that doesn't resolve to some JS module that has a runtime it... it thinks of |
Granted and I completely agree. That still leaves a question, how do we handle this situation gracefully? Would returning empty file contents to V8 work? We can't just leave this situation as is, because it's happening to many people (even though it's "their" fault for not using |
So I did tentative fix for this issue in #6760 by providing empty module for declaration files. I don't think that's the best solution as it relies on |
What about just returning any empty file for a compiled cache miss? |
@kitsonk I guess that would also work, I need to think if there are unwanted side effects of this approach... 🤔 |
Less panics? Covering over some other internal defect? We could log a warning saying that an empty module was detected, and that the user is likely doing something wrong. That way any issues wouldn't get swallowed, but they wouldn't result in panics. |
Try it out locally:
$ deno cache https://git.io/JJsqz
The quick hacky fix is to forcefully emit an empty file when when tsc skips emitting the file. We know which files we are expecting to be emitted because they should map 1:1 to the input (source) files.
cc @bartlomieju
The text was updated successfully, but these errors were encountered: