ReferenceError: globalThis is not defined

Hey guys its been weeks that my app was running great in broswer as serve or serve -l and on some android devices as build -prod and build as apk or run.
but not running on other devices like android v8.1 it was just the blank white screen

now i found a way to remote debugg it in chrome devtools, this is the error output:

ReferenceError: globalThis is not defined
    at Module.<anonymous> (vendor-es5.js:158248)
    at Module.spgP (vendor-es5.js:158400)
    at __webpack_require__ (runtime-es5.js:85)
    at Module.ZAI4 (main-es5.js:295)
    at __webpack_require__ (runtime-es5.js:85)
    at Module.zUnb (main-es5.js:647)
    at __webpack_require__ (runtime-es5.js:85)
    at Object._ (main-es5.js:19)
    at __webpack_require__ (runtime-es5.js:85)
    at checkDeferredModules (runtime-es5.js:46)
capacitor.handleError @ capacitor-runtime.js:358
capacitor.handleWindowError @ capacitor-runtime.js:378

if i follow in those vendor-es5.js files the error that they is un undefined
globalThis. on these line of angular fire

globalThis.ɵAngularfireInstanceCache || (globalThis.ɵAngularfireInstanceCache = new Map());

help me know what to do in this situation plx
and thx in advance

1 Like

can some one plz help me with this “globalThis. is not defined issue”
my environment versions are

plz help solve this issue so i can ship my app to the client
thx

Hello,

Install globalthis:
npm install globalthis

Add:
import 'globalthis/auto';
in polyfills.ts

6 Likes

hi, where is it? (polyfills.ts)