Skip to content

Clound Functions Emulator Not handling query parameters for functions deployed locally.  #3032

@biologicalbattery

Description

@biologicalbattery

When deploying functions locally using the emulator, any time a request is to a function and the URL used to make that request has query parameters, the response is HTTP 400 error.

The following function was used:

export const helloWorld = functions.https.onRequest((req,res) => {
    console.log(req.query);
    res.send("Hello World");
});

When requesting this function using the url:
http://localhost:5001/{projectName}/{location}/helloWorld?id=test

I get a 400 error and in the emulator log the following happens:
function[helloWorld]
Beginning execution of "helloWorld"
14:52:13
W
function[helloWorld]
Your function timed out after ~60s. To configure this timeout, see
https://firebase.google.com/docs/functions/manage-functions#set_timeout_and_memory_allocation.
14:52:13
I
function[helloWorld]
C:\Users\Ansaar Dollie\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:640
14:52:13
I
function[helloWorld]
throw new Error("Function timed out.");
14:52:13
I
function[helloWorld]
^
14:52:13
I
function[helloWorld]

14:52:13
I
function[helloWorld]
Error: Function timed out.
14:52:13
I
function[helloWorld]
at Timeout._onTimeout (C:\Users\Ansaar Dollie\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:640:19)
14:52:13
I
function[helloWorld]
at listOnTimeout (internal/timers.js:554:17)
14:52:13
I
function[helloWorld]
at processTimers (internal/timers.js:497:7)

Firebase Tools version: 9.2.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions