forked from denoland/deno
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: providing empty source code for missing compiled files (denoland…
…#6760) This commit adds a fallback mechanism for absent compiled source file. Because imported type declaration files are not emitted by TS compiler and their imports are not elided users often hit "No such file or directory" error. With this commit in such situation an empty source file will be provided to V8 with a warning to the user suggesting using "import type"/ "export type" syntax instead.
- Loading branch information
1 parent
121eaa4
commit 6e34f6a
Showing
5 changed files
with
29 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface HelloWorld { | ||
a: string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./ts_type_only_import.d.ts"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Check [WILDCARD]ts_type_only_import.ts | ||
Warning Failed to get compiled source code of "[WILDCARD]ts_type_only_import.d.ts". | ||
Reason: [WILDCARD] (os error 2) | ||
If the source file provides only type exports, prefer to use "import type" or "export type" syntax instead. |