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

Fixing invalid version error when emulating functions #4497

Merged
merged 3 commits into from
Apr 28, 2022

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Apr 28, 2022

Description

When unable to identify the version of firebase-functions in use, we were throwing TypeError: Invalid Version: errors due to trying to parse "" into Semver. This should fix #4403, where some users are experiencing this when trying to emulate functions.

@joehan joehan requested a review from taeold April 28, 2022 20:46
@@ -129,6 +129,18 @@ export class Delegate {
env: backend.EnvironmentVariables
): Promise<backend.Backend> {
if (previews.functionsv2) {
if (semver.valid(this.sdkVersion)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

if (!semver.valid(this.sdkVersion))

instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, that's what i get for moving too quickly.

@joehan joehan enabled auto-merge (squash) April 28, 2022 21:02
@joehan joehan merged commit 89d4dd8 into master Apr 28, 2022
@kaibolay kaibolay deleted the jh-invalid-version branch September 15, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Functions Emulator Getting TypeError: Invalid Version: when updating to anything above 10.2.1
2 participants