-
Notifications
You must be signed in to change notification settings - Fork 4k
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
🐛 [firebase_core_web] flutterfire_ignore_scripts and firebase_core is not defined #12204
Comments
Hi @mwoelk, would it be possible to provide a complete minimal reproducible code sample in a repo that we can clone so that we can investigate this? I tried to reproduce with the steps outlined above, but I don't see the Thank you |
Hi @danagbemava-nc, Sure. I cloned the repo and modified the firebase_core example app to ignore the scripts and added a copy of The error message shown in the console is different if you run in debug or release. In debug (
In release (
|
I guess it's because the dart implementation expects a |
When I use the following, the previous errors disappear but instead I alway get a It seems like when th files get injected automatically there is something more going on than just importing the files. <script type="module">
import * as core from "./vendor/firebase-app.js";
import * as messaging from "./vendor/firebase-messaging.js";
window["firebase_core"] = core;
window["firebase_messaging"] = messaging;
window.flutterfire_ignore_scripts = ["core", "messaging"];
</script> |
Hi @mwoelk, thanks for the clarification in #12204 (comment). I was able to see the same error. But it seems like that issue has been resolved(?). When do you get this issue in #12204 (comment)? |
He @danagbemava-nc , unfortunately the issue is not resolved yet. I wasn't able to import/set-up the external scripts in a way that would work exactly like the default auto-injection logic. It seems to me that there is some additional set-up / scoping going on when the scripts are injected through the dart code. So the code above just changes the initial error message to another error but won't. The "Service messaging is not available" error is thrown when I try to call So my best guess would be that there is some scoping issues going on. |
Thanks for the details. I am not particularly familiar with this area so I will be labeling this for further insight from the team. |
Ok. Guess I found some more information. import{registerVersion as e,_registerComponent as t,_getProvider,getApp as n}from"https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js"; This leads the browser to fetch another version of firebase-app which of course is uninitalized. I guess either the docs need to be updated or the CDN files should be using relative imports ;) |
Bug report
Describe the bug
To comply with GDPR we are not allowed to load any scripts from a third party domain such as
*.gstatic.com
. Because in this case, the IP address of the user which is deemed personal information is handed over to a third party without the users consent.Because of this, I wanted to use
flutterfire_ignore_scripts
as described in the setup docs.I downloaded the js files and added them to my
web/index.html
.I also added the following line before flutter gets loaded.
Now I get an error in the console stating
firebase_core is not defined
Steps to reproduce
Steps to reproduce the behavior:
firebase-app.js
andfirebase-messaging.js
scripts and add them manually toweb/index.html
window.flutterfire_ignore_scripts
line to the file as wellExpected behavior
firebase_core should be defined when manually including the scripts.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: