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

Functions Emulator Getting TypeError: Invalid Version: when updating to anything above 10.2.1 #4403

Closed
BrandiATMuhkuh opened this issue Apr 6, 2022 · 1 comment · Fixed by #4497
Assignees

Comments

@BrandiATMuhkuh
Copy link

BrandiATMuhkuh commented Apr 6, 2022

[REQUIRED] Environment info

firebase-tools: 10.2.1 -> 10.2.2 or higher

Platform: Windows

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

I start my emulator using the following firebase.json file.

{
    "database": {
        "rules": "database.rules.json"
    },
    "firestore": {
        "rules": "firestore.rules",
        "indexes": "firestore.indexes.json"
    },
    "functions": {
        "source": "projects/cloud-functions"
    },
    "hosting": [
        {
            "target": "api",
            "rewrites": [
                {
                    "source": "**",
                    "function": "api"
                }
            ]
        }
    ],
    "storage": {
        "rules": "storage.rules"
    },
    "emulators": {
        "auth": {
            "port": 9099,
            "host": "0.0.0.0"
        },
        "functions": {
            "port": 5001,
            "host": "0.0.0.0"
        },
        "firestore": {
            "port": 8080,
            "host": "0.0.0.0"
        },
        "database": {
            "port": 9000,
            "host": "0.0.0.0"
        },
        "hosting": {
            "port": 5000,
            "host": "0.0.0.0"
        },
        "storage": {
            "port": 9199,
            "host": "0.0.0.0"
        },
        "ui": {
            "enabled": true,
            "port": 4090,
            "host": "0.0.0.0"
        }
    }
}

[REQUIRED] Expected behavior

When I update my firebase-tools I expect that the emulator still works.

[REQUIRED] Actual behavior

When I update to anything higher then 10.2.1 I'm getting a TypeError: Invalid Version: error.

Here is the full stack

[debug] [2022-04-05T13:52:26.132Z] TypeError: Invalid Version: 
    at new SemVer (C:\Users\j\development\AmI\node_modules\firebase-tools\node_modules\semver\semver.js:323:11)
    at compare (C:\Users\j\development\AmI\node_modules\firebase-tools\node_modules\semver\semver.js:614:10)
    at Function.lt (C:\Users\j\development\AmI\node_modules\firebase-tools\node_modules\semver\semver.js:648:10)
    at Delegate.discoverSpec (C:\Users\j\development\AmI\node_modules\firebase-tools\lib\deploy\functions\runtimes\node\index.js:87:24)
    at FunctionsEmulator.loadTriggers (C:\Users\j\development\AmI\node_modules\firebase-tools\lib\emulator\functionsEmulator.js:272:61)
    at async Promise.all (index 0)
    at async FunctionsEmulator.connect (C:\Users\j\development\AmI\node_modules\firebase-tools\lib\emulator\functionsEmulator.js:231:9)
    at async Object.startAll (C:\Users\j\development\AmI\node_modules\firebase-tools\lib\emulator\controller.js:487:13)
    at async Command.actionFn (C:\Users\j\development\AmI\node_modules\firebase-tools\lib\commands\emulators-start.js:28:35)
[error] 
[error] Error: An unexpected error has occurred.
@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

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 a pull request may close this issue.

3 participants