Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
NodeJS "No overload matches this call." error with typescript

I'm trying to create NodeJS app from scratch with typescript addition... I was following some tutorial and basically did the same steps as he did yet he didn't receive this error... Did NodeJS or TypeScript get some kind of updates that are causing this error?

Problem is that I'm receiving error on index.ts file POST with getAllUsers controller and I have no clue what is it about:

No overload matches this call. The last overload gave the following error. Argument of type '(req: Request, res: Response) => Promise' is not assignable to parameter of type 'Application<Record<string, any>>'. Type '(req: Request, res: Response<any, Record<string, any>>) => Promise' is missing the following properties from type 'Application<Record<string, any>>': init, defaultConfiguration, engine, set, and 61 more.

Any help is welcome :)

index.ts file:

import * as functions from "firebase-functions";
import * as express from "express";
import {getAllUsers } from "./controllers/usersController";

const app = express();
app.post("/users",getAllUsers);
app.get("/", (req, res) => res.status(200).send("default route!"));

exports.app = functions.https.onRequest(app);

Controller file:

const getAllUsers = async (req: Request, res: Response) => {
  let userArray: any[] = [];

  try {
    const user = await db.collection("userInfo").get();

    if (!user.docs) {
      res.status(404).send("not found");
    } else {
      user.docs.forEach((user) =>
        userArray.push({id: user.id, user: user.data()})
      );
    }
    res.status(200).send("<p>some html</p>");
  } catch (error) {
    res.status(500).send("error.message");
  }
};

export {getAllUsers};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I got stuck for hours for this one. I hope this helped. Try changing the format of the code from
import {getAllUsers } from "./controllers/usersController"; & export {getAllUsers};

to import getAllUsers from "./controllers/usersController"; & export default getAllUsers;

Have the same problem with importing

After changing the code

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!