-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 Manual Javascript injection doesnt work as docs describe #11744
Comments
Thanks for the report @willcalderbank |
Hey @willcalderbank. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Apologies @darshankawar i've been away for a week. Thanks for looking into it. Here's a more complete sample (which follows the doc's instructions):
If causes the following errors in the console:
As the error states the modulular versions of the JS cant be imported like this, so instead we can try and use namespaced versions:
In which case the following error is thrown:
The only way ive been able to get it to work is to use the following:
Note the version change to 10.3.1. At one point during testing a warning showed that this was the version to use with the flutter sdk. Version 10.5.0 did not work with the above Hope this helps. |
Thanks for the detailed update. Seeing the same behavior as reported. |
Thanks for the doc change but I fear its not correct {{web_sdk_version}} is the latest version, it doesn't work with that version only 10.3.1. It also doesn't address the problem that all of the js libs force firebase-app.js to be downloaded via gstatic.com |
Bug report
The docs found at https://firebase.google.com/docs/flutter/setup?platform=web#disable-auto state that the JS auto injection can be disabled using
window.flutterfire_ignore_scripts
which is true however it also states they can be manually loaded by just including a script tag. Ie:This doesnt appear to work.
After reading through the source I figured out that you can import them as follows:
However all the firebase-x.js scripts have the path to
firebase-app.js
hardcoded within the import statements preventing any override of app/core.Steps to reproduce
Steps to reproduce the behavior:
In index.html place:
Errors thrown in the console
Expected behavior
That analytics and firestore are fetched from the path given and firebase to initialize correctly
Additional context
The ability to prevent the JS auto injecting allow control of what files are downloaded, in our case we need to run fully offline this prevents that. Even if the manually loading worked as documented it would still mean
firebase-app.js
is always fetched fromgstatic.com
The text was updated successfully, but these errors were encountered: