Title: Auth: Cannot use `browserPopupRedirectResolver` on demand · Issue #3038 · angular/angularfire · GitHub
Open Graph Title: Auth: Cannot use `browserPopupRedirectResolver` on demand · Issue #3038 · angular/angularfire
X Title: Auth: Cannot use `browserPopupRedirectResolver` on demand · Issue #3038 · angular/angularfire
Description: Version info Angular: 12.2.12 Firebase: 9.2.0 AngularFire:: 7.1.1 How to reproduce these conditions Steps to set up and reproduce Initialiaze firebase auth without a popup resolver. This prevents the infamous iframe.js to load. provideAu...
Open Graph Description: Version info Angular: 12.2.12 Firebase: 9.2.0 AngularFire:: 7.1.1 How to reproduce these conditions Steps to set up and reproduce Initialiaze firebase auth without a popup resolver. This prevents t...
X Description: Version info Angular: 12.2.12 Firebase: 9.2.0 AngularFire:: 7.1.1 How to reproduce these conditions Steps to set up and reproduce Initialiaze firebase auth without a popup resolver. This prevents t...
Opengraph URL: https://github.com/angular/angularfire/issues/3038
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Auth: Cannot use `browserPopupRedirectResolver` on demand","articleBody":"\u003c!--\r\n\r\nIMPORTANT! YOU MUST FOLLOW THESE INSTRUCTIONS OR YOUR ISSUE WILL BE CLOSED.\r\n\r\nThank you for contributing to the Angular and Firebase communities!\r\n\r\nHave a usage question?\r\n=======================\r\nWe get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Here are some resources to get help:\r\n\r\n- Go through the Developer's Guide: https://github.com/angular/angularfire2#developer-guide\r\n\r\nIf the official documentation doesn't help, try asking through our officially supported channels:\r\n\r\n- Firebase Google Group: https://groups.google.com/forum/#!forum/firebase-talk\r\n- Stack Overflow: https://stackoverflow.com/questions/tagged/angular (include the firebase and angularfire tags, too!)\r\n\r\n*Please avoid double posting across multiple channels!*\r\n\r\nThink you found a bug?\r\n=======================\r\nYeah, we're definitely not perfect! Please use the bug report template below and include a minimal repro when opening the issue.\r\n\r\nHave a feature request?\r\n========================\r\nGreat, we love hearing how we can improve our products! Remove the template below and\r\nprovide an explanation of your feature request. Provide code samples if applicable. Try to\r\nthink about what it will allow you to do that you can't do today? How will it make current\r\nworkarounds straightforward? What potential bugs and edge cases does it help to avoid?\r\n\r\n-->\r\n\r\n\r\n### Version info\r\n\r\n\u003c!-- What versions of the following libraries are you using? Note that your issue may already\r\nbe fixed in the latest versions. -->\r\n\r\n**Angular:** 12.2.12\r\n\r\n**Firebase:** 9.2.0\r\n\r\n**AngularFire:**: 7.1.1\r\n\r\n### How to reproduce these conditions\r\n\r\n**Steps to set up and reproduce**\r\n\r\nInitialiaze firebase auth without a popup resolver. This prevents the infamous iframe.js to load.\r\n\r\n``` \r\nprovideAuth(() => {\r\n const auth: Auth = initializeAuth(getApp(), {\r\n persistence: [\r\n indexedDBLocalPersistence,\r\n browserLocalPersistence,\r\n browserSessionPersistence\r\n ],\r\n popupRedirectResolver: undefined\r\n });\r\n if (environment.emulator) {\r\n connectAuthEmulator(auth, 'http://localhost:9099', {disableWarnings: true});\r\n }\r\n\r\n return auth;\r\n }),\r\n```\r\n\r\nThen when a social auth is required, load the resolver on demand:\r\n\r\n```\r\nimport {Auth, browserPopupRedirectResolver, signInWithPopup, GoogleAuthProvider} from '@angular/fire/auth';\r\n\r\n\r\nawait signInWithPopup(this.auth, new GoogleAuthProvider(), browserPopupRedirectResolver);\r\n```\r\n\r\n\u003c!-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->\r\n\r\n### Debug output\r\n\r\n** Errors in the JavaScript console **\r\n\r\n```\r\nGoogleSigninDirective.onclick() TypeError: Class constructor BrowserPopupRedirectResolver cannot be invoked without 'new'\r\n at angular-fire.js:206\r\n at angular-fire.js:163\r\n at ZoneDelegate.invoke (zone.js:372)\r\n at Object.onInvoke (core.js:28680)\r\n at ZoneDelegate.invoke (zone.js:371)\r\n at Zone.run (zone.js:134)\r\n at NgZone.run (core.js:28534)\r\n at run (angular-fire.js:163)\r\n at new \u003canonymous> (angular-fire.js:206)\r\n at _getInstance (index-238d6fa9.js:535)\r\n at _withDefaultResolver (index-238d6fa9.js:7714)\r\n at index-238d6fa9.js:7931\r\n at Generator.next (\u003canonymous>)\r\n at asyncGeneratorStep (asyncToGenerator.js:3)\r\n at _next (asyncToGenerator.js:25)\r\n at asyncToGenerator.js:32\r\n at new ZoneAwarePromise (zone.js:1387)\r\n at asyncToGenerator.js:21\r\n at _signInWithPopup (index-238d6fa9.js:7934)\r\n at signInWithPopup (index-238d6fa9.js:7928)\r\n at angular-fire.js:225\r\n at angular-fire.js:160\r\n at ZoneDelegate.invoke (zone.js:372)\r\n at Zone.run (zone.js:134)\r\n at NgZone.runOutsideAngular (core.js:28579)\r\n at runOutsideAngular (angular-fire.js:160)\r\n at angular-fire.js:225\r\n at AuthService.\u003canonymous> (auth.service.ts:38)\r\n at Generator.next (\u003canonymous>)\r\n at tslib.es6.js:76\r\n at new ZoneAwarePromise (zone.js:1387)\r\n at __awaiter (tslib.es6.js:72)\r\n at AuthService.google (auth.service.ts:37)\r\n at AuthService.descriptor.value (track-event.decorator.ts:32)\r\n at GoogleSigninDirective.\u003canonymous> (google-signin.directive.ts:21)\r\n at Generator.next (\u003canonymous>)\r\n at tslib.es6.js:76\r\n at new ZoneAwarePromise (zone.js:1387)\r\n at __awaiter (tslib.es6.js:72)\r\n at GoogleSigninDirective.onclick (google-signin.directive.ts:20)\r\n at GoogleSigninDirective.descriptor.value (catch.decorator.ts:41)\r\n at GoogleSigninDirective_click_HostBindingHandler (google-signin.directive.ts:8)\r\n at executeListenerWithErrorHandling (core.js:15315)\r\n at wrapListenerIn_markDirtyAndPreventDefault (core.js:15353)\r\n at HTMLButtonElement.\u003canonymous> (platform-browser.js:561)\r\n at HTMLButtonElement.sentryWrapped (helpers.js:73)\r\n at ZoneDelegate.invokeTask (zone.js:406)\r\n at Object.onInvokeTask (core.js:28667)\r\n at ZoneDelegate.invokeTask (zone.js:405)\r\n at Zone.runTask (zone.js:178)\r\n```\r\n\r\n### Expected behavior\r\n\r\n\u003c!-- What is the expected behavior? -->\r\n\r\nThe popup should open.\r\n\r\n### Actual behavior\r\n\r\n\u003c!-- What is the actual behavior? -->\r\n\r\nThe popup is not opening, instead you see the described error.\r\n\r\n### Temporary workaround\r\n\r\nAs a temporary workaround, I import all dependencies directly from 'firebase/auth'. Don't know though, if this could have a negative impact on Angular (Zone)\r\n\r\n```\r\nimport {browserPopupRedirectResolver, GoogleAuthProvider, signInWithPopup} from 'firebase/auth';\r\n```\r\n","author":{"url":"https://github.com/vandres","@type":"Person","name":"vandres"},"datePublished":"2021-10-30T10:49:45Z","url":"https://github.com/angular/angularfire/issues/3038"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:abbb8fcb-2d37-e31e-3d9f-400441d2f26a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8154:2C07B2:A2983:DA68B:6B03696B |
| html-safe-nonce | 2d6bc25ee0af1632cd0c58388a18863a3c481f4875efa3f51dce60691df83c91 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTU0OjJDMDdCMjpBMjk4MzpEQTY4Qjo2QjAzNjk2QiIsInZpc2l0b3JfaWQiOiI1MzQ0NTM4NTAxODQ3NDExMDUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 146bcd9e4743d5f27b33d534ef768161b3c3f344c860fac8fdc4625909062d61 |
| hovercard-subject-tag | issue:1040114049 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3038/issue_layout |
| twitter:image | https://opengraph.githubassets.com/961eb307f01b8fd8f2a2358bfe0c402b602ddd004f2f8b0a5dc70cf684b3a7b2/angular/angularfire/issues/3038 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/961eb307f01b8fd8f2a2358bfe0c402b602ddd004f2f8b0a5dc70cf684b3a7b2/angular/angularfire/issues/3038 |
| og:image:alt | Version info Angular: 12.2.12 Firebase: 9.2.0 AngularFire:: 7.1.1 How to reproduce these conditions Steps to set up and reproduce Initialiaze firebase auth without a popup resolver. This prevents t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vandres |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width