Error when accessing properties on globalThis
with the same name of a global variable
#58345
Labels
Milestone
globalThis
with the same name of a global variable
#58345
π Search Terms
globalThis redefined error script property does not exist
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?noImplicitAny=false&ts=5.5.0-beta#code/DYUwLgBAlgdgbgQ2FAJgRggXggc2AewCMkAVACygGcA6WRZdAbgChRIBPLXA44cq2vCSo0LNhABeXPEVIUadYSgBMLIA
π» Code
π Actual behavior
Property 'invalid1' does not exist on type 'typeof globalThis'.
π Expected behavior
It should either complain about both
invalid1
andinvalid2
, or neitherAdditional information about the issue
It only happens in scripts and not in modules (if I add
export {}
, there are no reported errors).The text was updated successfully, but these errors were encountered: