Skip to content

No information for Error: Debug Failure. No error for last overload signature #35186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bene-starzengruber opened this issue Nov 19, 2019 · 9 comments
Labels
Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Needs Investigation This issue needs a team member to investigate its status.
Milestone

Comments

@bene-starzengruber
Copy link

bene-starzengruber commented Nov 19, 2019

TypeScript Version: 3.7.2

Search Terms:
Debug Failure, No error for last overload signature, Typescript 3.7.2, Sonar

Code / Error
Code is not available - executing entity is sonar runner

As well formatted image
image

or as code...

Analyzing 292 typescript file(s) with the following configuration file /jenkins/workspace/Viper/Nova-Web/trunk/nova/packages/Nova/nova-app/tsconfig.json
00:20:19  00:20:18.347 ERROR - /jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:2137
00:20:19  00:20:18.347 ERROR -             throw e;
00:20:19  00:20:18.347 ERROR -             ^
00:20:19  00:20:18.347 ERROR - 
00:20:19  00:20:18.347 ERROR - Error: Debug Failure. No error for last overload signature
00:20:19  00:20:18.347 ERROR -     at resolveCall (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:55202:38)
00:20:19  00:20:18.348 ERROR -     at resolveCallExpression (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:55548:20)
00:20:19  00:20:18.348 ERROR -     at resolveSignature (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:55904:28)
00:20:19  00:20:18.348 ERROR -     at getResolvedSignature (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:55935:26)
00:20:19  00:20:18.348 ERROR -     at getContextualTypeForArgumentAtIndex (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:52352:118)
00:20:19  00:20:18.348 ERROR -     at getContextualTypeForArgument (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:52347:50)
00:20:19  00:20:18.348 ERROR -     at getContextualType (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:52718:28)
00:20:19  00:20:18.348 ERROR -     at getApparentTypeOfContextualType (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:52620:17)
00:20:19  00:20:18.348 ERROR -     at getContextualSignature (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:52924:24)
00:20:19  00:20:18.348 ERROR -     at getContextuallyTypedParameterType (/jenkins/workspace/Viper/Nova-Web/trunk/nova/node_modules/typescript/lib/typescript.js:52200:39)
00:20:19  00:20:18.390 ERROR - External process `node --max-old-space-size=2048 /jenkins/workspace/Viper/Nova-Web/trunk/nova/packages/Nova/nova-app/.sonar/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner` returned an empty output. Run with -X for more information

Expected behavior:
Should give some additional information what the problem is

Actual behavior:
When looking at the error, I have no idea if it's an issue with my application code, with sonar or with typescript itself

@RyanCavanaugh
Copy link
Member

It's a crash, so by definition something has broken in an unexpected way 😢

Some code snippet that would reproduce this crash would be extremely helpful - would you be able to share an example? We might be able to deduce what went wrong from staring at the code, but it takes a lot longer

@enzy
Copy link

enzy commented Dec 3, 2019

So we use TS 3.7.2 and are getting this error while using @mangoweb/scripts-base v0.0.12

We hit this error when we try to initialize a class which extends our Component.ts

We are able to overcome this error with following ways:

  • downgrade of TS to 3.6
  • downgrade of scripts-base to v0.0.10
  • set "strictFunctionTypes": false in tsconfig.json

@enzy
Copy link

enzy commented Dec 3, 2019

@RyanCavanaugh I made a minimal test case for our version of Debug Failure Error: https://github.com/enzy/ts-scriptsbase-debug-failure

@pprice
Copy link

pprice commented Apr 26, 2020

I have another minimal repo for this, with [email protected] and @apache-arrow/[email protected]

src/test.ts

import { Table } from "@apache-arrow/ts";

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "outDir": "./dist/"
  }
}
<snip>\node_modules\.pnpm\registry.npmjs.org\typescript\3.8.3\node_modules\typescript\lib\tsc.js:81040
                throw e;
                ^

Error: Debug Failure. No error for last overload signature
    at resolveCall (<snip>\node_modules\.pnpm\registry.npmjs.org\typescript\3.8.3\node_modules\typescript\lib\tsc.js:47385:38)
    at resolveCallExpression (<snip>\node_modules\.pnpm\registry.npmjs.org\typescript\3.8.3\node_modules\typescript\lib\tsc.js:47680:20)

@tuomokar
Copy link

I had this with the latest version of TypeScript (currently 4.3.2), but setting the "includes" property in tsconfig.json removed the issue.

@RyanCavanaugh RyanCavanaugh added Needs Investigation This issue needs a team member to investigate its status. and removed Needs More Info The issue still hasn't been fully clarified labels Jun 15, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 15, 2021
@ksabry
Copy link

ksabry commented Sep 30, 2021

I have encountered this issue in TypeScript 4.4.3, I don't know if further examples are wanted but this minimal repro may be useful since it's standalone (no packages); the error seems to occur no matter the tsconfig options, I tested that it still occurs with no tsconfig at all.

interface CollectionDocument<TIdPrefix extends string> {
	id: `${TIdPrefix}_${string}`;
}

type CollectionDocumentIdPrefix<TCollectionDocument extends CollectionDocument<string>> =
	TCollectionDocument["id"] extends `${infer TIdPrefix}_${string}` ? TIdPrefix : never;

type CollectionSpecs = { [name: string]: CollectionDocument<string>; };

type CollectionSpecNames<TCollectionNames extends string> = TCollectionNames | `History_${TCollectionNames}`;

interface HistoryDocument<TDocument extends CollectionDocument<string>> extends CollectionDocument<`hist_${CollectionDocumentIdPrefix<TDocument>}`> {
	document: TDocument | null;
}

type CollectionFromName<
	TCollectionSpecs extends CollectionSpecs,
	TCollectionName extends CollectionSpecNames<keyof TCollectionSpecs & string>,
> =
	TCollectionName extends `History_${infer TOriginalCollectionName}`
		? Collection<HistoryDocument<TCollectionSpecs[TOriginalCollectionName]>>
		: Collection<TCollectionSpecs[TCollectionName]>;

class Driver<TCollectionSpecs extends CollectionSpecs = CollectionSpecs> {
	public getCollection<TCollectionName extends CollectionSpecNames<keyof TCollectionSpecs & string>>(): CollectionFromName<TCollectionSpecs, TCollectionName> {
		// This line seems to be the origin of the error, the 'this' argument specifically
		return new Collection<CollectionDocument<string>>(this) as any;
	}
}

class Collection<TDocument extends CollectionDocument<string>> {
	public driver: Driver;
	public document: TDocument;

	public constructor(driver: Driver) {
		this.driver = driver;
	}
}

@bagbag
Copy link

bagbag commented Feb 18, 2022

An other example:

versions:
typescript: 4.5.5 and 4.7.0-dev.20220218
mongodb: 4.4.0

import { Collection } from 'mongodb';
import type { OptionalUnlessRequiredId } from 'mongodb';

export type MongoDocument<T> = OptionalUnlessRequiredId<Omit<T, 'id'> & { _id: string }>;

export type MongoDocumentWithPartialId<T> = OptionalUnlessRequiredId<Omit<T, 'id'> & { _id?: string }>;

export declare function toProjectedEntity<T extends Entity>(document: MongoDocumentWithPartialId<T>): any;

export class MongoBaseRepository<T extends Entity> {
  readonly collection: Collection<any>;

  async loadManyProjectedByFilter(): Promise<any> {
    const documents = await this.collection.find<MongoDocument<T>>({}).toArray();
    return [documents.map(toProjectedEntity)];
  }
}

Only happens if Entity is an non existing type.

@Renatopster
Copy link

The point about this issue should be to emit more detailed feedback whenever it happens, so we can troubleshoot it by ourselves.
This other issue has a suggestion about how to do that:
#33133 (comment)
It would already be a great improvement, but if it were also possible to retrieve the file/line where the call happened, it would be perfect.

@CodingDive
Copy link

CodingDive commented Feb 13, 2025

Also just happened to me on v5.7.3.

Error: Debug Failure. No error for last overload signature
    at resolveCall (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:75289:19)
    at resolveCallExpression (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:75683:12)
    at resolveSignature (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:76111:16)
    at getResolvedSignature (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:76138:18)
    at checkCallExpression (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:76249:23)
    at checkExpressionWorker (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:79677:16)
    at checkExpression (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:79576:32)
    at checkExpressionStatement (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:82151:5)
    at checkSourceElementWorker (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:85157:16)
    at checkSourceElement (app\node_modules\.pnpm\[email protected]\node_modules\typescript\lib\_tsc.js:85009:7)

I had a type like this

type IVariant = 'success | 'destructive';

And forgot to add as const when passing the variant to a function.

showToast({ variant: 'success' }) => showToast({ variant: 'success' as const }) fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

10 participants