-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
SvelteKit, Cloudflare & Firebase Errors #3921
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
Comments
This is kinda off-topic, but AFAIK you shouldn't put the firebase secrets in your index.svelte. I think the user can get that. |
I am experiencing similar issues with Netlify adapter. |
I get this from fiddler:
|
Please provide a repository that reproduces this issue. From the issue template:
|
It's perfectly normal and expected for the client-side config to be exposed on the client, it's not secret and is required for Firebase to function. What would be bad is if any service-account credentials were exposed. These are typically used by |
I use firebase + SvelteKit a lot, I'm not seeing this issue. It's possible that it's TODO with the cloudflare adapter but your SvelteKit version is quite outdated by 25 releases so I'd start with updating that to confirm if it's still a live issue. As well as the , In case it helps, I tried to explain this approach here: |
This seems likely to be an issue in Firebase: firebase/firebase-js-sdk#6042. Closing in favor of that issue since it's not clear that there's anything to do in SvelteKit |
Describe the bug
When deploying SvelteKit app with basic Firebase initialisation to Cloudflare Pages I'm getting the following errors:
After refreshing the browser window errors change to (NOTE: not a real web address):
At the same time, in console I can see another error:
It is my understanding that the errors are caused by improper initialisation of Firebase. As I already wrap the initialisation in
if (browser)
and check Firebase'sisSupported
I'm not sure if the mistake is mine or is it a bug withsveltekit
/cloudflare-adapter
.As locally everything is working just fine, I'm leaning towards an issue with
cloudflare-adapter
.Reproduction
npm init svelte@next
@sveltejs/adapter-cloudflare
as a dev dependency.@sveltejs/adapter-auto
to@sveltejs/adapter-cloudflare
insvelte.config.js
.firebase
as a regular dependency.<script>
tag ofindex.svelte
:System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: