Skip to content
JS
Errors

TypeScript errors

TSxxxx compiler errors.

1,407 entries0 written pages
Showing 201 to 250 of 1,407Source: TypeScript diagnosticMessages.json
CodeError
TS1250Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'.
TS1251Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Class definitions are automatically in strict mode.
TS1252Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. Modules are automatically in strict mode.
TS1253Abstract properties can only appear within an abstract class.
TS1254A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.
TS1255A definite assignment assertion '!' is not permitted in this context.
TS1257A required element cannot follow an optional element.
TS1258A default export must be at the top level of a file or module declaration.
TS1259Module '{0}' can only be default-imported using the '{1}' flag
TS1260Keywords cannot contain escape characters.
TS1261Already included file name '{0}' differs from file name '{1}' only in casing.
TS1262Identifier expected. '{0}' is a reserved word at the top-level of a module.
TS1263Declarations with initializers cannot also have definite assignment assertions.
TS1264Declarations with definite assignment assertions must also have type annotations.
TS1265A rest element cannot follow another rest element.
TS1266An optional element cannot follow a rest element.
TS1267Property '{0}' cannot have an initializer because it is marked abstract.
TS1268An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type.
TS1269Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled.
TS1270Decorator function return type '{0}' is not assignable to type '{1}'.
TS1271Decorator function return type is '{0}' but is expected to be 'void' or 'any'.
TS1272A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and...
TS1273'{0}' modifier cannot appear on a type parameter
TS1274'{0}' modifier can only appear on a type parameter of a class, interface or type alias
TS1275'accessor' modifier can only appear on a property declaration.
TS1276An 'accessor' property cannot be declared optional.
TS1277'{0}' modifier can only appear on a type parameter of a function, method or class
TS1278The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}.
TS1279The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}.
TS1280Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set...
TS1281Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead.
TS1282An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type.
TS1283An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration.
TS1284An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type.
TS1285An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration.
TS1286ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'.
TS1287A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled.
TS1288An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled.
TS1289'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider...
TS1290'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider...
TS1291'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type'...
TS1292'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type...
TS1293ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'.
TS1294This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
TS1295ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest...
TS1300'with' statements are not allowed in an async function block.
TS1308'await' expressions are only allowed within async functions and at the top levels of modules.
TS1309The current file is a CommonJS module and cannot use 'await' at the top level.
TS1312Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern.
TS1313The body of an 'if' statement cannot be the empty statement.

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