Skip to content
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

Regression in how "long" is imported breaks Cloud Functions for Firebase #1246

Closed
inlined opened this issue May 4, 2022 · 3 comments
Closed
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@inlined
Copy link

inlined commented May 4, 2022

Public issue for StackOverflow. I also noticed our integration tests failing.

It seems this is because @types/long uses export = syntax. You can usually get away with using a standard import when someone uses export =, but documentation is quite clear that you're supposed to use import = require() in these cases. If the moon is in the wrong phase, a traditional import breaks. This issue seems to be hitting Firebase customers.

@inlined inlined added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 4, 2022
@alexander-fenster
Copy link
Contributor

Is it still the problem with the latest version of google-gax, v2.30.3, that pins @grpc/proto-loader to v0.6.9 and should use long v4, not v5?

@alexander-fenster
Copy link
Contributor

Just to give you some details - google-gax does not use long directly, but needs its types for these proto .d.ts files, so we just have @types/long as a devDependency. That worked well with long v4. In long v5 they apparently publish their own types that have precedence over @types/long, so might cause problems if a dependency pulls long v5 in the tree. I pinned one of such dependencies (@grpc/proto-loader) so it should now pull long v4.

We are going to fix imports anyway, it's just a little bit more complicated than the PR you sent, because we need to fix all 100+ client libraries first, and update google-gax at the same time. We are on it.

@inlined
Copy link
Author

inlined commented May 12, 2022

This is fixed in recent versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants