Property 'analytics' does not exist on type 'Window & typeof globalThis'.
When running ng test I get the following error on all of my spec tests:
Property 'analytics' does not exist on type 'Window & typeof globalThis'.
This is strange as I did declare the analytics property as instructed?
declare global { interface Window { analytics: any; } }
Hello all. I'm also hitting: property 'analytics' does not exist on type 'Window'. I also set the declare global { interface Window { analytics: any; } }. Any ideas? Thanks in advance!
@Carl-Meyer @realtysapient try adding the keyword export, as in:
/* eslint-disable */
export declare global {
interface Window {
analytics?: any;
}
}
/* eslint-enable */
does that work for you? another less ideal situation is to rename your use of window.analytics to globalThis.analytics
@benjaminhoffman this doesn't work for me, and also causes another problem:
'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.
El tipo de archivo debe ser .d.ts para evitar el error de export.
@benjaminhoffman this doesn't work for me, and also causes another problem:
'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.