René's URL Explorer Experiment


Title: Inject() must be called from an injection context such as a constructor in AngularFirestoreDoc after upgrading to Angular v19 · Issue #3621 · angular/angularfire · GitHub

Open Graph Title: Inject() must be called from an injection context such as a constructor in AngularFirestoreDoc after upgrading to Angular v19 · Issue #3621 · angular/angularfire

X Title: Inject() must be called from an injection context such as a constructor in AngularFirestoreDoc after upgrading to Angular v19 · Issue #3621 · angular/angularfire

Description: I recently upgraded all dependencies to Angular v19 (from v18). I was previously on Angular v18 where everything worked fine. However, now, my whole console is spammed with the following error: ERROR RuntimeError: NG0203: inject() must b...

Open Graph Description: I recently upgraded all dependencies to Angular v19 (from v18). I was previously on Angular v18 where everything worked fine. However, now, my whole console is spammed with the following error: ERR...

X Description: I recently upgraded all dependencies to Angular v19 (from v18). I was previously on Angular v18 where everything worked fine. However, now, my whole console is spammed with the following error: ERR...

Opengraph URL: https://github.com/angular/angularfire/issues/3621

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inject() must be called from an injection context such as a constructor in AngularFirestoreDoc after upgrading to Angular v19","articleBody":"I recently upgraded all dependencies to Angular v19 (from v18). I was previously on Angular v18 where everything worked fine. However, now, my whole console is spammed with the following error:\n\n```\nERROR RuntimeError: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`. Find more at https://angular.dev/errors/NG0203\n    at injectInjectorOnly (core.mjs:1104:11)\n    at ɵɵinject (core.mjs:1114:40)\n    at inject (core.mjs:1199:10)\n    at \u003cinstance_members_initializer> (angular-fire-compat-firestore.mjs:93:14)\n    at new AngularFirestoreDocument (angular-fire-compat-firestore.mjs:98:3)\n    at _AngularFirestore.doc (angular-fire-compat-firestore.mjs:621:12)\n    at auth.service.ts:38:14\n    at switchMap.js:16:17\n    at OperatorSubscriber2._this._next (OperatorSubscriber.js:14:9)\n    at Subscriber2.next (Subscriber.js:32:12)\n```\n\nHowever, my auth service at line 38:14 only has the following code:\n``.doc\u003cUser>(`users/${user.uid}`)``\n\nThe whole constructor looks like this (it is a angular service class)\n```@Injectable({\n  providedIn: 'root',\n})\nexport class AuthService {\n  isLoggedIn$: Observable\u003cboolean>;\n  /** User data of database */\n  user$: Observable\u003cUser | null | undefined>;\n  userRoles$: Observable\u003cstring[]>;\n  userId: string | undefined = undefined;\n  username: string | undefined = undefined;\n\n  constructor(\n    readonly firestore: AngularFirestore,\n    readonly fireAuth: AngularFireAuth,\n    readonly router: Router,\n  ) {\n    this.user$ = this.fireAuth.authState.pipe(\n      switchMap((user) => {\n        if (user) {\n          this.userId = user.uid;\n          return this.firestore\n            .doc\u003cUser>(`users/${user.uid}`)\n            .valueChanges()\n            .pipe(\n              map((userData) => {\n                if (userData) {\n                  this.username = userData.username; // Assign username\n                }\n                return userData;\n              }),\n            );\n        } else {\n          this.userId = undefined;\n          this.username = undefined;\n          return new Observable\u003cUser | null>((observer) => observer.next(null));\n        }\n      }),\n    );\n```\n\nBut I dont really know, why it does not work anymore in angular 19.\n\nMy package dependencies:\n```\n \"dependencies\": {\n    \"@angular/animations\": \"^19.1.5\",\n    \"@angular/cdk\": \"^19.1.3\",\n    \"@angular/common\": \"^19.1.5\",\n    \"@angular/compiler\": \"^19.1.5\",\n    \"@angular/core\": \"^19.1.5\",\n    \"@angular/fire\": \"^19.0.0\",\n    \"@angular/forms\": \"^19.1.5\",\n    \"@angular/material\": \"^19.1.3\",\n    \"@angular/platform-browser\": \"^19.1.5\",\n    \"@angular/platform-browser-dynamic\": \"^19.1.5\",\n    \"@angular/router\": \"^19.1.5\",\n    \"@fortawesome/angular-fontawesome\": \"^1.0.0\",\n    \"@fortawesome/free-brands-svg-icons\": \"^6.7.1\",\n    \"@fortawesome/free-regular-svg-icons\": \"^6.7.1\",\n    \"@fortawesome/free-solid-svg-icons\": \"^6.7.1\",\n    \"@ng-select/ng-select\": \"^14.2.2\",\n    \"@ngx-translate/core\": \"^15.0.0\",\n    \"@ngx-translate/http-loader\": \"^8.0.0\",\n    \"angular-build-info\": \"^2.0.1\",\n    \"canvas-confetti\": \"^1.9.3\",\n    \"flowbite\": \"^2.5.2\",\n    \"ng-recaptcha-2\": \"^15.0.2\",\n    \"ngx-editor\": \"^18.0.0\",\n    \"ngx-quill\": \"^27.0.0\",\n    \"quill\": \"^2.0.3\",\n    \"quill2-emoji\": \"^0.1.2\",\n    \"rxjs\": \"~7.8.0\",\n    \"tslib\": \"^2.8.1\",\n    \"tw-elements\": \"^2.0.0\",\n    \"zone.js\": \"^0.15.0\"\n  },\n```\n\nI also tried to set  \"preserveSymlinks\": false, in angular.json however, the issue still persists.","author":{"url":"https://github.com/djamn","@type":"Person","name":"djamn"},"datePublished":"2025-02-12T15:14:12Z","url":"https://github.com/angular/angularfire/issues/3621"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c5d676bd-f419-9653-dce5-262a4e861cc3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8E00:C727A:6D5790:8ABF87:6B0356DF
html-safe-nonce9c5b3c1e6ac0f81e01840c152d1a3d51f14c79b22d73959ae523a0a3595a1ba9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTAwOkM3MjdBOjZENTc5MDo4QUJGODc6NkIwMzU2REYiLCJ2aXNpdG9yX2lkIjoiMjc3NjAzMzY0MDkxMDY0MDg2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac49cef73f13e061216fcc21e8a4d757997df2c66be5047954e73aa363a616be9d
hovercard-subject-tagissue:2848559540
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3621/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f069e0f1963c6974772ccf2e803cd61e87bc28440a47b7ee890d8105445a1360/angular/angularfire/issues/3621
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f069e0f1963c6974772ccf2e803cd61e87bc28440a47b7ee890d8105445a1360/angular/angularfire/issues/3621
og:image:altI recently upgraded all dependencies to Angular v19 (from v18). I was previously on Angular v18 where everything worked fine. However, now, my whole console is spammed with the following error: ERR...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedjamn
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/angular/angularfire git https://github.com/angular/angularfire.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id49453413
octolytics-dimension-repository_nwoangular/angularfire
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49453413
octolytics-dimension-repository_network_root_nwoangular/angularfire
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angularfire/issues/3621#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fissues%2F3621
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fissues%2F3621
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangularfire
Reloadhttps://github.com/angular/angularfire/issues/3621
Reloadhttps://github.com/angular/angularfire/issues/3621
Reloadhttps://github.com/angular/angularfire/issues/3621
angularhttps://github.com/angular
angularfirehttps://github.com/angular/angularfire
Codehttps://github.com/angular/angularfire
Issues162 (162)https://github.com/angular/angularfire/issues
Pull requests5 (5)https://github.com/angular/angularfire/pulls
Discussionshttps://github.com/angular/angularfire/discussions
Actionshttps://github.com/angular/angularfire/actions
Projectshttps://github.com/angular/angularfire/projects
Security and qualityhttps://github.com/angular/angularfire/security
Insightshttps://github.com/angular/angularfire/insights
https://github.com/angular/angularfire
New issuehttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3621
New issuehttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3621
Inject() must be called from an injection context such as a constructor in AngularFirestoreDoc after upgrading to Angular v19https://github.com/angular/angularfire/issues/3621#top
comp: compatCompatibility layer for the pre-modular API (src/compat).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20compat%22
needs: investigationNeeds maintainer investigation before it can be worked.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22needs%3A%20investigation%22
type: bugDefect: expected behavior doesn't happen.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
version: current (v17+)Targets the current modular API (v17+).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22version%3A%20current%20(v17%2B)%22
https://github.com/djamn
djamnhttps://github.com/djamn
on Feb 12, 2025https://github.com/angular/angularfire/issues/3621#issue-2848559540
https://github.com/google-oss-bot
google-oss-bothttps://github.com/google-oss-bot
on Feb 12, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2654017547
https://github.com/FidelNguyen
FidelNguyenhttps://github.com/FidelNguyen
on Feb 12, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2654529062
https://github.com/codeneobee
codeneobeehttps://github.com/codeneobee
on Feb 17, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2663398965
https://github.com/rgant
rganthttps://github.com/rgant
on Feb 17, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2663905029
https://firebase.google.com/docs/web/modular-upgradehttps://firebase.google.com/docs/web/modular-upgrade
https://github.com/djamn
djamnhttps://github.com/djamn
on Feb 19, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2668207351
https://firebase.google.com/docs/web/modular-upgradehttps://firebase.google.com/docs/web/modular-upgrade
https://github.com/rgant
rganthttps://github.com/rgant
on Feb 19, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2668497709
injection contexthttps://github.com/angular/angularfire/pull/3590#issuecomment-2581455741
https://github.com/djamn
djamnhttps://github.com/djamn
on Feb 20, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2671253864
https://github.com/rgant
rganthttps://github.com/rgant
on Feb 20, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2671369607
https://github.com/djamn
djamnhttps://github.com/djamn
on Feb 23, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2676973208
https://github.com/kevin-induro
kevin-indurohttps://github.com/kevin-induro
on May 13, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2877690699
https://github.com/JGSolutions
JGSolutionshttps://github.com/JGSolutions
on May 29, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2919153067
https://github.com/sasos90
sasos90https://github.com/sasos90
on May 30, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2921794261
https://github.com/vkpatel007
vkpatel007https://github.com/vkpatel007
on Jun 23, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-2994713168
https://github.com/syamanashi
syamanashihttps://github.com/syamanashi
on Jul 5, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3040145054
#3590 (comment)https://github.com/angular/angularfire/pull/3590#issuecomment-2581455741
https://github.com/astridsoraya
astridsorayahttps://github.com/astridsoraya
on Jul 15, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3073566420
https://github.com/tscislo
tscislohttps://github.com/tscislo
on Jul 21, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3095807841
https://github.com/tscislo
tscislohttps://github.com/tscislo
on Jul 23, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3107692336
https://github.com/sasos90
sasos90https://github.com/sasos90
on Jul 25, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3117411803
@tscislohttps://github.com/tscislo
https://github.com/tscislo
tscislohttps://github.com/tscislo
on Jul 25, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3117531840
@sasos90https://github.com/sasos90
https://github.com/syamanashi
syamanashihttps://github.com/syamanashi
on Jul 25, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3117791324
@sasos90https://github.com/sasos90
https://github.com/cm-cm-cm-cm
cm-cm-cm-cmhttps://github.com/cm-cm-cm-cm
on Jul 30, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3136533496
https://github.com/tscislo
tscislohttps://github.com/tscislo
on Jul 30, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3136925389
@syamanashihttps://github.com/syamanashi
https://github.com/madmacc
madmacchttps://github.com/madmacc
on Oct 8, 2025https://github.com/angular/angularfire/issues/3621#issuecomment-3382851573
https://github.com/angular/angularfire/releases/tag/19.0.0-rc.5https://github.com/angular/angularfire/releases/tag/19.0.0-rc.5
armando-navarrohttps://github.com/armando-navarro
comp: compatCompatibility layer for the pre-modular API (src/compat).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20compat%22
needs: investigationNeeds maintainer investigation before it can be worked.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22needs%3A%20investigation%22
type: bugDefect: expected behavior doesn't happen.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
version: current (v17+)Targets the current modular API (v17+).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22version%3A%20current%20(v17%2B)%22
on Jul 25, 2026https://github.com/angular/angularfire/issues/3621#event-28470469057
https://github.com/armando-navarro
armando-navarrohttps://github.com/armando-navarro
on Jul 26, 2026https://github.com/angular/angularfire/issues/3621#issuecomment-5082907050
zones guidehttps://github.com/angular/angularfire/blob/main/docs/zones.md
https://github.com/armando-navarro
armando-navarrohttps://github.com/armando-navarro
on Nov 5, 2026https://github.com/angular/angularfire/issues/3621#issuecomment-6672486146
#3683https://github.com/angular/angularfire/issues/3683
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angularfire/issues/3621
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3621
comp: compatCompatibility layer for the pre-modular API (src/compat).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20compat%22
needs: investigationNeeds maintainer investigation before it can be worked.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22needs%3A%20investigation%22
type: bugDefect: expected behavior doesn't happen.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%22
version: current (v17+)Targets the current modular API (v17+).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22version%3A%20current%20(v17%2B)%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.