-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9.0.0 Auth doesn't work: GoogleAuthProvider is failing FederatedAuthProvider and BaseOAuthProvider instanceof assertions #5420
Comments
Hi @jpike88, thanks for reporting this behavior. If I can replicate the issue, I can have a better look into it. Please share a minimal, but complete sample of a project that I can run locally. |
am arranging this as a priority within the hour... hang tight |
Note: In making this, I'm almost certain the issue is specific to the Ready. Instructions: Run Then use ts-node or tsc in the base folder, and then run: and then go to localhost:4444. Look for a file called app.component.ts and that will contain the code I'm testing. You can put your test firebase credentials in there. Also, notice I put a little code in to fool the library into thinking the environment is Cordova so the same error is fired. You'll see a button called CLICK ME, click it and look at the console. |
I found the issue, I was using the I should have used the But this is super annoying of a design flaw! There should be a warning if people are accidentally mixing libraries like that, they seem to have an identical API and it's easy to get stuck on thinking the bundler was the problem. |
Glad to know that it is a library mix-up issue and not the SDK itself. As a suggestion, I recommend adding the validation of libraries used to prevent this particular scenario. |
Well I think it warrants at least a note in the documentation. Otherwise it's like 'don't press this red button, press the other red button'. |
@sam-gc We could produce a better error message in case people mix up the submodule imports. Firestore does something similar by checking the expected instance type and throw if it doesn't match. See https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/util/input_validation.ts#L166-L172 Reopening .. |
(I use fuse-box as a bundler, and my code is being output to ES2015 code, and I have countless other libraries in my codebase that run fine.)
Things were working with Firebase 8.x, but after upgrading to 9 and migrating to the required code:
This code doesn't work, an assertion fails here:
https://github.com/firebase/firebase-js-sdk/blame/509c18fbc1a0d4f85a0ca8c7cfef8e3b0f3183ec/packages/auth/src/platform_browser/strategies/redirect.ts#L95
See attached image for what inspecting breakpointed variables looks like:
see this comment for detailed further investigation
Current workaround, on postinstall do a find+sed on the @firebase folder, and replace all instances of
provider instanceof FederatedAuthProvider
andprovider instanceof BaseOAuthProvider
withtrue
in order to disable the asserts, and everything works properly.The text was updated successfully, but these errors were encountered: