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
To support libraries that use node global variables, a new --unstable-node-globals variable was added in #26611
However, using this flag with the --check flag fails because Typescript (and the IDE) isn't aware of this flag
Ex: if you have the following code
type Foo = Buffer;
It will fail with
TS2580 [ERROR]: Cannot find name 'Buffer'.
type Foo = Buffer;
This can be fixed by adding the following to your project
declare global {typeBuffer=typeofimport("node:buffer").Buffer;}
Or (possibly?) with specifying some lib settings. Ideally somehow Deno would know to make this work if you use the flag (but I don't see how the IDE could know this), or at least make a more useful error message that tells you to change your deno.json file to fix this error
The text was updated successfully, but these errors were encountered:
To support libraries that use node global variables, a new
--unstable-node-globals
variable was added in #26611However, using this flag with the
--check
flag fails because Typescript (and the IDE) isn't aware of this flagEx: if you have the following code
It will fail with
This can be fixed by adding the following to your project
Or (possibly?) with specifying some
lib
settings. Ideally somehow Deno would know to make this work if you use the flag (but I don't see how the IDE could know this), or at least make a more useful error message that tells you to change yourdeno.json
file to fix this errorThe text was updated successfully, but these errors were encountered: