[🐞] Qwik - Build is Aggressively Treeshaking with Firebase
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 22.1k
- Forks
- 1.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Qwik Rollup/Vite plugin and reproduce the failure using the linked qwik-firebase-test repository and Vercel Edge demo. Compare the build output and runtime behavior with Firebase issue 8506; done means Firebase Auth initializes correctly in the Qwik Edge deployment without required SDK portions being tree-shaken.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, rollup, typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100