question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: globalThis is not defined

See original GitHub issue

Hey guys its been weeks that my app(ionic angular firebase) was running great in browser 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 debug 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 an undefined globalThis. on these lines of angular fire

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

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
ghostcommented, Feb 9, 2021

Hello,

Install globalthis: npm install globalthis

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

1reaction
google-oss-botcommented, Dec 19, 2020

This issue does not seem to follow the issue template. Make sure you provide all the required information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: globalThis is not defined - npm - Stack Overflow
Consider updating your version of node.js to >=12 . globalThis was added in node.js v12.0.0 according to this compatibility table.
Read more >
ReferenceError: globalThis is not defined · Issue #2795 - GitHub
ReferenceError : globalThis is not defined at evalmachine.<anonymous>:1:1 at Script.runInContext (vm.js:133:20) at Object.
Read more >
globalThis is not defined although node version is v14.4.0
ReferenceError : globalThis is not defined. Run. If you experience errors saying that globalThis is not defined, be sure to run a recent ......
Read more >
ReferenceError: globalThis is not defined
Hey guys,. I am working on the ionic project and I am facing one issue. my app is working fine if I run...
Read more >
'globalThis' is not defined - Microsoft Community
I am not able to access any files on Microsoft Teams and any time I try to ''globalThis' is not defined" keeps coming...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found