question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript: https.Request only contains .rawBody, no other properties

See original GitHub issue

Related issues

Nope

[REQUIRED] Version info

node: 12.14.0

firebase-functions: 3.3.0

firebase-tools: 7.7.0

firebase-admin: 7.11.0

[REQUIRED] Test case

functions.https.onRequest(async (request, response) => {
        console.log(request.query) // Property query does not exist on type Request

        return response.send("ok")
})

[REQUIRED] Steps to reproduce

[REQUIRED] Expected behavior

I expect the type query to actually exist.

[REQUIRED] Actual behavior

functions.https.onRequest(async (request, response) => {
        console.log(request.query) // Property query does not exist on type Request

        return response.send("ok")
})

This has changed since I updated firebase-functions from 3.0.1 to 3.3.0. Downgrading doesn’t seem to work. It is a typing issue with typescript.

Were you able to successfully deploy your functions?

Since I run TypeScript before deploying, no

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kossnocorpcommented, Apr 12, 2020

Same here after upgrading from 3.3.0 to 3.6.0. In my case, it complains about such code:

functions.https.onRequest((_req, resp) => resp.end())

Property ‘end’ does not exist on type ‘Response<any>’

2reactions
JaapWeijlandcommented, May 4, 2020

Next findings: I had express installed next to firebase-functions. Deleting this from my package.json resulted in a correct install of firebase-functions, including @types/express-serve-static-core. The request.query typing problem persists though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express missing properties when using typescript: rawBody
My temporary fix is to use the as keyword to tell the compiler to consider the req object as another type when you...
Read more >
raw-body - npm
Gets the entire buffer of a stream either as a Buffer or a string. Validates the stream's length against an expected length and...
Read more >
Documentation - ECMAScript Modules in Node.js - TypeScript
js files are interpreted as ES modules or CommonJS modules, and defaults to CommonJS when not set. When a file is considered an...
Read more >
Types and Parameters - OpenAPI - Documentation | NestJS
Types and parameters. The SwaggerModule searches for all @Body() , @Query() , and @Param() decorators in route handlers to generate the API document....
Read more >
TypeScript | Fastify 中文网
Plugins may or may not include typings. See Plugins for more information. We encourage users to send pull requests to improve typings support....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found