-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
[REQUIRED] Environment info
firebase-tools: 13.23.0
Platform: macOS
[REQUIRED] Test case
Create a task function including _
(underscore) symbol in its name:
import * as functions from 'firebase-functions/v2';
exports.admin_V1 = functions.tasks.onTaskDispatched(
{
secrets: ['SECRET'],
rateLimits: {},
minInstances: 1,
},
async (event) => {
console.debug(event);
},
);
[REQUIRED] Steps to reproduce
- Create project with the function above
- run
firebase emulators:start
[REQUIRED] Expected behavior
Should actually create function. Or as I see in this case, at least, it should have logged the correct error.
Also what's the workaround? If underscore is not allowed, can I give some other name to the queue and keep the function name to include underscore?
[REQUIRED] Actual behavior
[1] ⚠ Error adding Task Queue function: FirebaseError: Unable to parse JSON: SyntaxError: Unexpected token I in JSON at position 0
[1] i functions[us-central1-admin_v1]: function ignored because the http emulator does not exist or is not running.
[1] [2024-10-29T16:51:05.592Z] Got response from /__/functions.yaml {"endpoints":{"admin_v1":{"platform":"gcfv2","availableMemoryMb":null,"timeoutSeconds":null,"minInstances":1,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"secretEnvironmentVariables":[{"key":"SECRET"}],"labels":{},"taskQueueTrigger":{"retryConfig":{"maxAttempts":null,"maxDoublings":null,"maxBackoffSeconds":null,"maxRetrySeconds":null,"minBackoffSeconds":null},"rateLimits":{"maxConcurrentDispatches":null,"maxDispatchesPerSecond":null}},"entryPoint":"admin_v1"}},"specVersion":"v1alpha1","requiredAPIs":[{"api":"cloudtasks.googleapis.com","reason":"Needed for task queue functions"}],"extensions":{}}
[1] ✔ functions: Loaded functions definitions from source: admin_v1. {"metadata":{"emulator":{"name":"functions"},"message":"Loaded functions definitions from source: admin_v1."}}
[1] [2024-10-29T16:51:05.607Z] addTaskQueueTrigger {"retryConfig":{"maxAttempts":null,"maxRetrySeconds":null,"maxBackoffSeconds":null,"maxDoublings":null,"minBackoffSeconds":null},"rateLimits":{"maxConcurrentDispatches":null,"maxDispatchesPerSecond":null}}
[1] [2024-10-29T16:51:05.607Z] >>> [apiv2][query] POST http://127.0.0.1:9499/projects/project/locations/us-central1/queues/admin_v1 [none]
[1] [2024-10-29T16:51:05.607Z] >>> [apiv2][body] POST http://127.0.0.1:9499/projects/project/locations/us-central1/queues/admin_v1 {"retryConfig":{"maxAttempts":null,"maxRetrySeconds":null,"maxBackoffSeconds":null,"maxDoublings":null,"minBackoffSeconds":null},"rateLimits":{"maxConcurrentDispatches":null,"maxDispatchesPerSecond":null},"defaultUri":"http://127.0.0.1:5051/project/us-central1/admin_v1"}
[1] [2024-10-29T16:51:05.615Z] <<< [apiv2][status] POST http://127.0.0.1:9499/projects/project/locations/us-central1/queues/admin_v1 400
[1] [2024-10-29T16:51:05.615Z] <<< [apiv2][body] POST http://127.0.0.1:9499/projects/project/locations/us-central1/queues/admin_v1 "Invalid Queue ID"
[1] ⚠ Error adding Task Queue function: FirebaseError: Unable to parse JSON: SyntaxError: Unexpected token I in JSON at position 0 {"metadata":{"emulator":{"name":"functions"},"message":"Error adding Task Queue function: FirebaseError: Unable to parse JSON: SyntaxError: Unexpected token I in JSON at position 0"}}
[1] i functions[us-central1-admin_v1]: function ignored because the http emulator does not exist or is not running. {"metadata":{"emulator":{"name":"functions"},"message":"function ignored because the http emulator does not exist or is not running."}}