You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any code under deno with TypeScript 2.9.1 or later.
#22658 introduced a significant refactor of code. One of the areas defines the base64encode function which assumes that the argument host is always defined. In practice, this comes from ts.sys in which ts.sys is possibly undefined, but without the strict checking, this does not throw a compiler error, but at runtime in certain environments (like deno) an exception is thrown.
A simple check of host && host.base64encode there (and the following function base64decode restores functionality).
Expected behavior:
The code actually runs.
Actual behavior:
TypeError: Cannot read property 'base64encode' of undefined
at Object.base64encode (../node_modules/typescript/lib/typescript.js:12079:18)
at Object.getSourceMappingURL (../node_modules/typescript/lib/typescript.js:73929:46)
at printSourceFileOrBundle (../node_modules/typescript/lib/typescript.js:74550:48)
at emitJsFileOrBundle (../node_modules/typescript/lib/typescript.js:74499:13)
at emitSourceFileOrBundle (../node_modules/typescript/lib/typescript.js:74456:13)
at forEachEmittedFile (../node_modules/typescript/lib/typescript.js:74365:30)
at Object.emitFiles (../node_modules/typescript/lib/typescript.js:74446:9)
at emitWorker (../node_modules/typescript/lib/typescript.js:78992:33)
at ../node_modules/typescript/lib/typescript.js:78952:66
at runWithCancellationToken (../node_modules/typescript/lib/typescript.js:79043:24)
Related Issues:
Refs: ry/deno#117
The text was updated successfully, but these errors were encountered:
Actually, in looking a bit deeper, .sys is defined as always available, but the code internal to creating it logically assumes it can be undefined and there are quite a few uses of .sys it is assumed to be there. There is this TODO which indicates this has been noticed before.
I tried changing it to be | undefined and the whole sweater came unravelled so it clearly needs a bit more guidance to long term fix it.
TypeScript Version: 2.9.1+
Code
Any code under deno with TypeScript 2.9.1 or later.
#22658 introduced a significant refactor of code. One of the areas defines the
base64encode
function which assumes that the argumenthost
is always defined. In practice, this comes fromts.sys
in whichts.sys
is possibly undefined, but without the strict checking, this does not throw a compiler error, but at runtime in certain environments (like deno) an exception is thrown.A simple check of
host && host.base64encode
there (and the following functionbase64decode
restores functionality).Expected behavior:
The code actually runs.
Actual behavior:
Related Issues:
Refs: ry/deno#117
The text was updated successfully, but these errors were encountered: