fix(compile): transpile TypeScript imported at runtime (#34616)
A compiled binary could not dynamically import TypeScript that the program builds or discovers while running. The embedded module loader decoded data: and blob: URLs, and local files read from disk, straight to V8 as JavaScript, so any TypeScript syntax threw "SyntaxError: Unexpected token ':'". This blocked plugin-style use cases where a program imports TypeScript it assembles at runtime. The TypeScript transpiler (deno_ast) is already linked into every compiled binary through ext/node, so this transpiles those modules on the fly: data:/blob: URLs and local files that were not embedded at compile time. Modules embedded at compile time are unaffected, since they are still served pre-transpiled from the virtual file system. Note that compiled binaries remap embedded paths into a virtual root, so a runtime file: import must use a real on-disk absolute path (for example one derived from Deno.cwd()), not a specifier relative to import.meta.url. Closes #27945
B
Bartek Iwańczuk committed
09a2447afe28983503439f5f8b62f17347ffde53
Parent: d98660c
Committed by GitHub <noreply@github.com>
on 6/1/2026, 1:32:58 PM