[] Qwik - Build is Aggressively Treeshaking with Firebase
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
I've been working with the Firebase team to get Firebase working on Edge functions.
https://github.com/firebase/firebase-js-sdk/issues/8355
Firebase now works on ever single Framework, even in Edge Environments (Bun, Deno, Cloudflare)... except on Qwik.
Reproduction
https://qwik-firebase-test.vercel.app/
Steps to reproduce
Here is issue on Firebase with deployment instructions:
https://github.com/firebase/firebase-js-sdk/issues/8506
Repo: GitHub
Demo with error: Vercel Edge
System Info
Vercel Edge (no way to currently test this on Vercel Functions as there is not a Plugin)Additional Information
Here is what the Firebase team said after agressive testing:
I was able to reproduce the problem. It appears that something in the build pipeline is aggressively tree shaking portions of the Firebase JS SDK when it packages it for the edge runtime. The "service" mentioned in the log file is that fact that Auth cannot properly register itself with the instance of FirebaseApp (or FirebaseServerApp). This is due to the hooks it would use to register itself with the instance of App are inexplicitly missing from the SDK implementation.
Here is the link to the GitHub Issue:
https://github.com/firebase/firebase-js-sdk/issues/8506
Thanks,
J
Small Chance could be related to: https://github.com/QwikDev/qwik/issues/6322
Note: This could also be a Vercel Edge Plugin problem, but I'm not sure how the build process works.
Source: QwikDev/qwik