Skip to content

Double-read of a Shelf request #23

@kevmoo

Description

@kevmoo
>  DEBUG: Full request URL: http://localhost:5001/greetTyped
>  DEBUG: Request path: greetTyped
>  DEBUG: Request method: POST
>  DEBUG: Headers: {user-agent: Dart/3.12 (dart:io), connection: keep-alive, content-type: application/json, accept-encoding: gzip, content-length: 0, host: localhost:5001}
>  DEBUG: Trying to match CloudEvent function...
>  DEBUG: Content-Type: application/json
>  DEBUG: Trying structured content mode (JSON body)
>  DEBUG: Body length: 0 chars
>  Failed to parse CloudEvent for function matching: FormatException: Unexpected end of input (at character 1)
>
>  ^
>
>  DEBUG: Extracting function name from path: greetTyped
>  DEBUG: Path after removing leading slash: greetTyped
>  [ERROR] 2026-01-23 00:28:17.407914	0:00:00.005704	POST	/greetTyped
>  Bad state: The 'read' method can only be called once on a shelf.Request/shelf.Response object.
>  package:shelf/src/message.dart 165:34                             Message.readAsString
>  package:firebase_functions/src/https/callable.dart 424:33         RequestValidation.json
>  package:firebase_functions/src/https/https_namespace.dart 150:36  HttpsNamespace.onCallWithData.<fn>
>  package:firebase_functions/src/common/on_init.dart 83:25          withInit.<fn>
>  package:firebase_functions/src/server.dart 276:28                 _routeByPath
>
>  ERROR - 2026-01-23 00:28:17.423706
>  POST /greetTyped
>  Error thrown by handler.
>  Bad state: The 'read' method can only be called once on a shelf.Request/shelf.Response object.
>  package:shelf/src/message.dart 165:34                             Message.readAsString
>  package:firebase_functions/src/https/callable.dart 424:33         RequestValidation.json
>  package:firebase_functions/src/https/https_namespace.dart 150:36  HttpsNamespace.onCallWithData.<fn>
>  package:firebase_functions/src/common/on_init.dart 83:25          withInit.<fn>
>  package:firebase_functions/src/server.dart 276:28                 _routeByPath
>
i  functions: Finished "us-central1-greetTyped" in 20.058792ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions