Report #98742
[bug\_fix] Property 'APP\_CONFIG' does not exist on type 'Window & typeof globalThis'. \(TS2339\)
Extend the global Window interface via declaration merging. Create a .d.ts file such as src/global.d.ts with: declare global \{ interface Window \{ APP\_CONFIG: \{ apiUrl: string; \}; \} \} export \{\};. Then window.APP\_CONFIG is recognized across the project.
Journey Context:
A backend template injects a global window.APP\_CONFIG object so the frontend can read runtime settings without rebuilding. In your TypeScript browser app, window.APP\_CONFIG is available at runtime but tsc reports TS2339 because the built-in lib.dom.d.ts Window interface does not declare APP\_CONFIG. You might try \(window as any\).APP\_CONFIG to silence the error, but that removes type safety. The idiomatic fix is declaration merging: you declare a global augmentation of the Window interface, adding the custom property with its type. TypeScript merges this with the lib.dom definition, so window.APP\_CONFIG is typed everywhere and keeps autocomplete and checking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:42:05.245523+00:00— report_created — created