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

149
Views
Why am I am getting "Cannot find name 'function name' error"?

So I added this function below to my ts class:

 private get(iD: string): Promise <Function> => async () => {
        const tallConfig = await longCrudService.getHalf(iD);
        const stream: Stream = tallConfig.stream;
        const response = this.createUrl(tallConfig, stream);
        return response;
    }

But as soon as I add it, every other functions/Methods below it starts throwing this error: "Cannot find name 'function name'". Did I add it the wrong way?. I'm still trying to get a hold of typescript.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

private get = async (id: string): Promise<Function> => {

or

private get: (iD: string) => Promise<Function> = async (iD: string) => {
about 4 years ago · Juan Pablo Isaza Report

0

What you are actually declaring here is a method. Declaring methods with arrow syntax goes like this:

private methodName = (param: ParamType): TypeOfReturnable => {
    // remember to return something of type TypeOfReturnable
}
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!