René's URL Explorer Experiment


Title: "Warning: Firebase API called outside injection context" on non-async functions · Issue #3611 · angular/angularfire · GitHub

Open Graph Title: "Warning: Firebase API called outside injection context" on non-async functions · Issue #3611 · angular/angularfire

X Title: "Warning: Firebase API called outside injection context" on non-async functions · Issue #3611 · angular/angularfire

Description: This is related to #3605 and #3607 where a workaround has been suggested #3590 (comment). But my question is specifically for non-async functions. First of all, thank you @jamesdaniels for the new guide at https://github.com/angular/angu...

Open Graph Description: This is related to #3605 and #3607 where a workaround has been suggested #3590 (comment). But my question is specifically for non-async functions. First of all, thank you @jamesdaniels for the new ...

X Description: This is related to #3605 and #3607 where a workaround has been suggested #3590 (comment). But my question is specifically for non-async functions. First of all, thank you @jamesdaniels for the new ...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Warning: Firebase API called outside injection context\" on non-async functions","articleBody":"This is related to https://github.com/angular/angularfire/issues/3605 and https://github.com/angular/angularfire/issues/3607 where a workaround has been suggested https://github.com/angular/angularfire/pull/3590#issuecomment-2581455741.\nBut my question is specifically for non-async functions.\n\nFirst of all, thank you @jamesdaniels for the new guide at https://github.com/angular/angularfire/blob/main/docs/zones.md.\n(I think the doc would benefit from some concrete examples.)\n\nMy understanding is that direct calls to docData where it's called say from within an rxjs switchMap, should be wrapped in `runInInjectionContext`\n```typescript\n  loadDoc\u003cT>(docPath: string): Observable\u003cT | undefined> {\n      return docData\u003cT>(doc(this.firestore, docPath));\n  }\n```\n↓↓↓\n```typescript\n  private injectionContext = inject(EnvironmentInjector);\n\n  loadDoc\u003cT>(docPath: string): Observable\u003cT | undefined> {\n    return runInInjectionContext(this.injectionContext, () => {\n      return docData\u003cT>(doc(this.firestore, docPath));\n    });\n  }\n```\n\nHowever, even after adding `runInInjectionContext` wrappers for all load & set operations, there are still warnings from functions that are not async in nature such as `where, snapToData, serverTimestamp, increment, orderBy, limit`:\n\n![warnings on where, snapToData, serverTimestamp, increment, orderBy, limit](https://github.com/user-attachments/assets/336a6bbc-d148-452d-b9a6-babbc55fbf80)\n\nThis is because [`tools/build.ts`](https://github.com/angular/angularfire/blob/8ce95bf6f8de590f84206ae0c75e39ade458abc3/tools/build.ts) is applying `ɵzoneWrap` to every Firebase function:\n\nhttps://github.com/angular/angularfire/blob/8ce95bf6f8de590f84206ae0c75e39ade458abc3/src/firestore/rxfire.ts#L22-L27\n\nhttps://github.com/angular/angularfire/blob/8ce95bf6f8de590f84206ae0c75e39ade458abc3/src/firestore/firebase.ts#L76-L144\n\nShould AngularFire take a more granular approach and throw warnings only on async functions such as `docData` to avoid extraneous warnings?","author":{"url":"https://github.com/anisabboud","@type":"Person","name":"anisabboud"},"datePublished":"2025-01-12T13:36:46Z","url":"https://github.com/angular/angularfire/issues/3611"}

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:59841afc-cf3a-bdab-5363-dda313d6e5bf
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9A30:3BA415:A5883:D93C7:6B03602D
html-safe-noncef43958ff42bff7dfc75d5571144d178560258ece0320a04aa4b6d43054672293
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTMwOjNCQTQxNTpBNTg4MzpEOTNDNzo2QjAzNjAyRCIsInZpc2l0b3JfaWQiOiI3MTM4OTg2MDA4NTk4NzY1NjEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac7f231bf972296be94b74a9f67f64fb4f37ade53561e1ddfc87af6e88b25f2576
hovercard-subject-tagissue:2782490199
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/3611/issue_layout
twitter:imagehttps://opengraph.githubassets.com/dafbf6289646c6336172425c2004673fefadfffb919452b0d0d36125f87fc7fa/angular/angularfire/issues/3611
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/dafbf6289646c6336172425c2004673fefadfffb919452b0d0d36125f87fc7fa/angular/angularfire/issues/3611
og:image:altThis is related to #3605 and #3607 where a workaround has been suggested #3590 (comment). But my question is specifically for non-async functions. First of all, thank you @jamesdaniels for the new ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameanisabboud
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/3611#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fissues%2F3611
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%2F3611
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/3611
Reloadhttps://github.com/angular/angularfire/issues/3611
Reloadhttps://github.com/angular/angularfire/issues/3611
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/3611
New issuehttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3611
#3613https://github.com/angular/angularfire/pull/3613
"Warning: Firebase API called outside injection context" on non-async functionshttps://github.com/angular/angularfire/issues/3611#top
#3613https://github.com/angular/angularfire/pull/3613
https://github.com/anisabboud
anisabboudhttps://github.com/anisabboud
on Jan 12, 2025https://github.com/angular/angularfire/issues/3611#issue-2782490199
#3605https://github.com/angular/angularfire/issues/3605
#3607https://github.com/angular/angularfire/issues/3607
#3590 (comment)https://github.com/angular/angularfire/pull/3590#issuecomment-2581455741
@jamesdanielshttps://github.com/jamesdaniels
https://github.com/angular/angularfire/blob/main/docs/zones.mdhttps://github.com/angular/angularfire/blob/main/docs/zones.md
https://private-user-images.githubusercontent.com/5672108/402358938-336a6bbc-d148-452d-b9a6-babbc55fbf80.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUzODM2NDIsIm5iZiI6MTc5NTM4MzM0MiwicGF0aCI6Ii81NjcyMTA4LzQwMjM1ODkzOC0zMzZhNmJiYy1kMTQ4LTQ1MmQtYjlhNi1iYWJiYzU1ZmJmODAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTEyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMjJUMjEzNTQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjFlYmRjYmMzY2VjMTYxN2NlZmNhNmEyZDY4Y2JkNWEyYjA0YWU0ZWUzNTQ5NDJiYjY4ZmY4MDAzNWExZjYxYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.hK2KIEVrjQZboXQVsT2PMeTdZ5uEQlr9V-c_Y3E5Xuc
tools/build.tshttps://github.com/angular/angularfire/blob/8ce95bf6f8de590f84206ae0c75e39ade458abc3/tools/build.ts
angularfire/src/firestore/rxfire.tshttps://github.com/angular/angularfire/blob/8ce95bf6f8de590f84206ae0c75e39ade458abc3/src/firestore/rxfire.ts#L22-L27
8ce95bfhttps://github.com/angular/angularfire/commit/8ce95bf6f8de590f84206ae0c75e39ade458abc3
angularfire/src/firestore/firebase.tshttps://github.com/angular/angularfire/blob/8ce95bf6f8de590f84206ae0c75e39ade458abc3/src/firestore/firebase.ts#L76-L144
8ce95bfhttps://github.com/angular/angularfire/commit/8ce95bf6f8de590f84206ae0c75e39ade458abc3
https://github.com/google-oss-bot
google-oss-bothttps://github.com/google-oss-bot
on Jan 12, 2025https://github.com/angular/angularfire/issues/3611#issuecomment-2585738471
https://github.com/jamesdaniels
jamesdanielshttps://github.com/jamesdaniels
on Jan 13, 2025https://github.com/angular/angularfire/issues/3611#issuecomment-2587756249
jamesdanielshttps://github.com/jamesdaniels
completedhttps://github.com/angular/angularfire/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3613https://github.com/angular/angularfire/pull/3613
on Jan 16, 2025https://github.com/angular/angularfire/issues/3611#event-15966819144
https://github.com/anisabboud
anisabboudhttps://github.com/anisabboud
on Feb 3, 2025https://github.com/angular/angularfire/issues/3611#issuecomment-2630698763
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angularfire/issues/3611
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3611
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.