Skip to content
JS
Errors

TypeScript errors

TSxxxx compiler errors.

1,407 entries0 written pages
Showing 1 to 50 of 1,407Source: TypeScript diagnosticMessages.json
CodeError
TS1002Unterminated string literal.
TS1003Identifier expected.
TS1005'{0}' expected.
TS1006A file cannot have a reference to itself.
TS1007The parser expected to find a '{1}' to match the '{0}' token here.
TS1009Trailing comma not allowed.
TS1010'*/' expected.
TS1011An element access expression should take an argument.
TS1012Unexpected token.
TS1013A rest parameter or binding pattern may not have a trailing comma.
TS1014A rest parameter must be last in a parameter list.
TS1015Parameter cannot have question mark and initializer.
TS1016A required parameter cannot follow an optional parameter.
TS1017An index signature cannot have a rest parameter.
TS1018An index signature parameter cannot have an accessibility modifier.
TS1019An index signature parameter cannot have a question mark.
TS1020An index signature parameter cannot have an initializer.
TS1021An index signature must have a type annotation.
TS1022An index signature parameter must have a type annotation.
TS1024'readonly' modifier can only appear on a property declaration or index signature.
TS1025An index signature cannot have a trailing comma.
TS1028Accessibility modifier already seen.
TS1029'{0}' modifier must precede '{1}' modifier.
TS1030'{0}' modifier already seen.
TS1031'{0}' modifier cannot appear on class elements of this kind.
TS1034'super' must be followed by an argument list or member access.
TS1035Only ambient modules can use quoted names.
TS1036Statements are not allowed in ambient contexts.
TS1038A 'declare' modifier cannot be used in an already ambient context.
TS1039Initializers are not allowed in ambient contexts.
TS1040'{0}' modifier cannot be used in an ambient context.
TS1042'{0}' modifier cannot be used here.
TS1044'{0}' modifier cannot appear on a module or namespace element.
TS1046Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
TS1047A rest parameter cannot be optional.
TS1048A rest parameter cannot have an initializer.
TS1049A 'set' accessor must have exactly one parameter.
TS1051A 'set' accessor cannot have an optional parameter.
TS1052A 'set' accessor parameter cannot have an initializer.
TS1053A 'set' accessor cannot have rest parameter.
TS1054A 'get' accessor cannot have parameters.
TS1055Type '{0}' is not a valid async function return type in ES5 because it does not refer to a Promise-compatible constructor value.
TS1056Accessors are only available when targeting ECMAScript 5 and higher.
TS1058The return type of an async function must either be a valid promise or must not contain a callable 'then' member.
TS1059A promise must have a 'then' method.
TS1060The first parameter of the 'then' method of a promise must be a callback.
TS1061Enum member must have initializer.
TS1062Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method.
TS1063An export assignment cannot be used in a namespace.
TS1064The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?

Other families: JavaScript, Node.js, npm, React, Next.js, Vite, webpack, Jest