-
Notifications
You must be signed in to change notification settings - Fork 928
stopgap idb replacement broke TS compilation under node due to usage of DOMStringList in @firebase/util 1.5.0 #6085
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
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
For anyone coming here with the same problem, you can add the following to you
(works under npm 8.3+) |
This workaround may work for admin users since you won't have any of the idb dependent packages that were changed (app, analytics, app-check, performance, remote-config, messaging), but for anyone using In any case I will try to get out a fix ASAP. |
Sorry, I'm not really used to TS in Node and I'm trying to reproduce and I'm wondering if you can help me figure out how to do so. I've made a repo that has the deps:
And I've made a simple
And I've run that file with both |
@hsubox76 Thanks for the headsup about the workaround! I'm extremely sorry, I should've added better steps on how to reproduce this. To make it easier, I created this repo: https://github.com/Ranguna/reproducing-firebase-js-sdk-6085 Run I'll update the OP with this info. |
Also, another workaround is to set this in your tsconfig:
But that's also extremely risky because it's going to skip type checks for all packages, not just firebase. EDIT: This workaround will possibly break your app if you are running under node, since the introduced types are not available in a node environment. I've seen similar issues before that have worked in node, so there's a chance it's ok. Make sure you test your app thoroughly if you decide to go with this route. |
Thank you - this worked for us. |
Just FYI, "worked" is relative here. You just lost maybe 50% usefulness of typescript by toggling that setting. Since probably 99% of your total bundled code is located inside node_modules and maybe half of it is written in typescript (wishful thinking, I know); and you have now disabled all type checks around this. Like I said on my parent comment, make sure you test you code thoroughly; and no, unit tests are probably not enough. Just a friendly heads-up. Also, don't forget to toggle it back once this is fixed. |
True.. I cannot compile my project due to this issue, and I am still trying to figure which version of firebase would allow me to continue working Any ETA on this issue? |
ok, so what solved it for me, and this is really a temp solution till a fix would be introduced:
For some reason, only override didn't cut it.. This is not the first time something like that happens.. |
Forgot to link the issue in the PR but this PR should fix it and the release should go out today #6088 |
Awesome news @hsubox76 ,thanks for the update! |
It's been released in 9.6.10, please let me know if there are still any issues. |
Confirmed, I can no longer reproduce the issue. Thank you very much for the fix! |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
Install @firebase/util and compile under node environment.
To reproduce with
firebase-admin
(which has a dependency chain to@firebase/util
), you can checkout this repo: https://github.com/Ranguna/reproducing-firebase-js-sdk-6085Relevant Code:
2d672ce#diff-b8c22a8c7d8e12d84f62d2ee45dffda84efae4b8fa6588d1aac8f0d49909fd57R33
The above line introduced the usage of
DOMStringList
which is not available in node. This breaks ts compilations forfirebase-admin
through this dependency chainfirebase-admin -> @firebase/database-compat -> @firebase/util
.I am now stuck with
@firebase/util
< 1.5.0.Typescript compilation result:
The text was updated successfully, but these errors were encountered: