TS2304TS2304 — Cannot Find Name
TypeScript cannot find a variable, function, or type with the specified name in the current scope.
「compilation」タグの196件のエラーコード
TS2304TypeScript cannot find a variable, function, or type with the specified name in the current scope.
TS2345The argument passed to a function is not compatible with the expected parameter type.
TS2339TypeScript cannot find the specified property on the given type.
TS2307TypeScript cannot find the module specified in an import or require statement.
TS2322A value of one type cannot be assigned to a variable or property of a different, incompatible type.
TS2531TypeScript warns that an expression could be null at runtime, and you are using it without checking.
TS2554The number of arguments passed to a function does not match the number of required parameters.
TS2769None of the function overload signatures match the provided arguments.
TS7006A function parameter has no type annotation and TypeScript cannot infer its type.
TS1005TypeScript expected a specific token (like a semicolon, comma, or bracket) but found something else.
TS6133A variable, import, or parameter is declared but its value is never read.
TS2365An arithmetic or comparison operator is used with incompatible types.
TS2305The specified export does not exist in the referenced module.
TS2740An object type is missing required properties that are expected by the target type.
TS18048TypeScript warns that a value could be undefined and you are using it without checking.
TS2532TypeScript warns that an object expression could be undefined at runtime.
TS2741A required property is missing from the object being assigned.
TS2551TypeScript cannot find the property but suggests a similar name that might be what you intended.
TS1002A string literal is missing its closing quote.
TS1003TypeScript expected an identifier (variable name, function name, etc.) but found something else.
TS1109TypeScript expected an expression but found a token that cannot start an expression.
TS1128TypeScript expected a declaration or statement but found an unexpected token.
TS2306The file referenced in an import statement is not recognized as a module.
TS2314A generic type was used with the wrong number of type arguments.
TS2344A type argument does not meet the constraint specified by the generic type parameter.
TS2349The expression being called is not a function or callable type.
TS2353An object literal contains a property that does not exist on the target type.
TS2355A function with a declared return type does not return a value in all code paths.
TS2366A function with a non-void return type does not have a return statement at the end.
TS2367A comparison between two values will always be false because their types have no overlap.
TS2393A function with the same name is implemented more than once.
TS2394A function overload signature is not compatible with the implementation signature.
TS2416A property in a derived class is not compatible with the same property in the base class.
TS2420A class declares that it implements an interface but does not provide all required members.
TS2451A variable declared with let or const is being redeclared in the same scope.
TS2454A variable is used before it has been assigned a value.
TS2488The type being iterated does not have a Symbol.iterator method.
TS2493You are accessing a tuple element at an index that does not exist.
TS2503TypeScript cannot find a namespace with the specified name.
TS2515A non-abstract class that extends an abstract class does not implement all abstract members.
TS2540You are trying to modify a property that is marked as readonly.
TS2555The function call has fewer arguments than the minimum required.
TS2556The function was called with more arguments than it accepts.
TS2558A generic type or function is used without providing required type arguments.
TS2565A class property with a definite assignment assertion (!) is never read.
TS2564A class property is not initialized in the constructor and has no default value.
TS2571You are trying to use a value of type unknown without first narrowing its type.
TS2578A @ts-expect-error directive is present but no error occurs on the next line.
TS2588You are trying to reassign a variable declared with const.
TS2612A property in a derived class conflicts with a getter/setter accessor in the base class.
TS2683The this keyword has an implicit any type because there is no contextual type.
TS2684The this context of a function does not match the expected this type.
TS2694The specified member does not exist in the given namespace.
TS2696A TypeScript-only feature is being used in a JavaScript file.
TS2705An async function requires a higher ECMAScript target to compile.
TS2792TypeScript cannot resolve a module subpath because the package's exports field does not allow it.
TS2300The same identifier is declared more than once in the same scope.
TS7030A function with a return type does not return a value in all possible code paths.
TS7031A destructured binding element has an implicit any type.
TS7005A variable has an implicit any type because TypeScript cannot infer its type.
TS7041The default export expression does not have a type annotation.
TS6196A parameter is declared but its value is never read within the function body.
TS18046A value of type unknown is used in a position that requires a more specific type.
TS2497A CommonJS module is being imported with named import syntax but only has a default export.
TS1259A CommonJS module requires esModuleInterop or allowSyntheticDefaultImports to be imported with default import syntax.
TS1375The await keyword is used inside a function that is not marked as async.
TS1378Top-level await can only be used when the module option is set to a supported module system.
TS2430An interface declares that it extends another interface but has incompatible properties.
TS2461A destructuring pattern expects an array type but the value is not an array.
TS2347Type arguments were provided to a function that is not generic.
TS2395Merged declarations for the same name have inconsistent export modifiers.
TS2790The delete operator requires the operand to be an optional property.
TS2739An object type is missing multiple required properties from the target type.
TS1046An await expression or other top-level construct requires the file to be a module.
TS1056Getter/setter accessors require a higher ECMAScript target version.
TS1064The Promise constructor must be called with the new keyword.
TS1068An unexpected token was found inside a declaration file or declare block.
TS1149An import declaration conflicts with the ambient context of the file.
TS1192The module you are importing does not have a default export.
TS1202The import = require() syntax cannot be used in an ES module.
TS2328Two construct signatures (new() calls) have incompatible types.
TS2352A type assertion between two types that have no overlap might be an error.
TS2448A variable declared with let or const is referenced before its declaration in the same block.
TS2459A destructured import references a member that is not exported from the module.
TS2464A computed property name in a type literal must be a simple expression.
TS2507The expression used with new is not a constructor type.
TS2538The type of the index expression is not valid for indexing the object.
TS2559The source type has no properties in common with the target type.
TS2589A recursive type reaches TypeScript's maximum instantiation depth.
TS2590The resulting type expression creates a union with too many members for TypeScript to represent.
TS2610A derived class defines a property where the base class has an accessor.
TS2786A component's return type is not compatible with JSX element types.
TS17004JSX fragments (<>...</>) require a jsxFragmentFactory or React.Fragment to be available.
TS5097Two incompatible compiler options are set simultaneously in tsconfig.
TS5023An unrecognized option was found in tsconfig.json.
TS5075A compiler option requires a specific moduleResolution setting to be used.
TS1131TypeScript expected a property declaration or method signature but found something else.
TS1219Decorators require the experimentalDecorators compiler option to be enabled.
TS1270A decorator is placed before the export keyword, which is not allowed.
TS2775A type assertion function requires all parameter types to be explicitly annotated.
TS4111A property is accessed using a string index on a type that uses noPropertyAccessFromIndexSignature.
TS4058The return type of a function cannot be named without importing a type from another module.
TS4055The return type of an exported function references a private or non-exported type.
TS2698The spread operator (...) is used on a value that may not be an object type.
TS2362The left operand of an arithmetic expression must be a number or bigint type.
TS2363The right operand of an arithmetic expression must be a number or bigint type.
E0308The expected type does not match the actual type provided.
E0382A value is used after it has been moved to another variable or function.
E0502A value cannot be mutably borrowed while an immutable borrow is still active.
E0597A reference outlives the data it points to.
E0277A type does not implement a required trait.
E0599The method does not exist on the given type, or the required trait is not in scope.
E0425An identifier is used but not defined in the current scope.
E0433The module path used in a use statement or type path cannot be resolved.
E0106A reference in a function signature or struct is missing a lifetime parameter.
E0015A non-const function is called in a constant expression context.
E0658A feature that is not yet stabilized in Rust is being used without the feature gate.
E0609The struct or union does not have a field with the given name.
E0614The dereference operator (*) is used on a type that does not implement Deref.
E0499A value is borrowed mutably more than once at the same time.
E0503A value cannot be used while it is mutably borrowed by another variable.
E0505A value is moved while it is still borrowed by a reference.
E0507You are trying to move a value out of a reference, which would leave the reference dangling.
E0515A function tries to return a reference to a value that is created inside the function.
E0432The module or item referenced in a use statement cannot be found.
E0412A type name is used but not defined or imported in the current scope.
E0423A type name is used where a value was expected.
E0424The self keyword is used outside of a method or associated function context.
E0369A binary operator is used with types that do not support it.
E0384A variable is being reassigned but was not declared as mutable.
E0061A function was called with the wrong number of arguments.
E0063A struct is being constructed without all required fields.
E0107A generic type or function is used with the wrong number of type parameters.
E0117You are implementing a foreign trait for a foreign type, violating the orphan rule.
E0119Two or more implementations of the same trait exist for the same type.
E0133An unsafe function or operation is used outside of an unsafe block.
E0152A language item (#[lang = ...]) is defined more than once.
E0200An unsafe trait must be implemented with an unsafe impl block.
E0252Two imports bring the same name into scope.
E0255A local definition conflicts with an imported name.
E0271An associated type in a trait implementation does not match the expected type.
E0282Rust cannot infer the type of a value and needs an explicit annotation.
E0283Multiple trait implementations could apply, and Rust cannot determine which one to use.
E0310A generic type parameter does not satisfy a required lifetime bound.
E0317An if expression used as a value is missing an else branch.
E0373A closure captures a reference to a variable that may not live long enough.
E0392A generic type or lifetime parameter is declared but not used in the struct or enum.
E0404A type was used where a trait was expected.
E0405A trait name is used but not defined or imported in the current scope.
E0428An item with the same name is defined more than once in the same scope.
E0463The specified crate cannot be found by the compiler.
E0520Trait implementation specialization requires a nightly compiler feature.
E0596You are trying to mutably borrow a value that is not declared as mutable.
E0600A unary operator is applied to a type that does not support it.
E0601The binary crate does not have a main function entry point.
E0603You are trying to access a private item from outside its module.
E0621A function parameter needs an explicit lifetime annotation to satisfy the borrow checker.
E0308Different match arms return incompatible types.
E0716A reference is held to a temporary value that is immediately dropped.
E0728The .await keyword is used in a function that is not declared async.
clippy::needless_returnA return keyword is used unnecessarily at the end of a function.
clippy::let_and_returnA variable is declared and immediately returned on the next line.
clippy::unused_importsAn imported item is not used anywhere in the file.
clippy::clone_on_copyThe clone() method is called on a type that implements Copy.
clippy::unwrap_usedThe unwrap() method is used, which may panic at runtime.
dead_codeA function, struct, enum variant, or constant is defined but never used.
unused_variablesA variable is declared but never used in the code.
unused_mutA variable is declared as mutable but never actually mutated.
VerifyErrorThe bytecode verifier detects malformed or illegal bytecode.
ClassFormatErrorA class file has an invalid format or structure.
TS2783A spread argument in a function call must be a tuple type or passed to a rest parameter.
TS2820A JSX element type does not have any matching call or construct signatures.
TS1343The import/export syntax requires the file to be treated as a module.
TS2742The inferred type of a declaration cannot be named without a dependency that is not available.
TS18047TypeScript warns that a value could be null and you are using it without checking.
TS2810A JSX attribute expected a boolean value but received a different type.
TS2353An object literal passed directly to a function contains properties not in the expected type.
TS2339A prop is passed to a React component that does not accept it in its type definition.
TS2786The expression cannot be used as a JSX component because its return type is not valid.
TS1479The relative import path requires a file extension under Node.js ESM resolution.
TS2688TypeScript cannot find the type definition file specified in types or typeRoots.
TS4082The default export requires a type annotation when generating declaration files.
TS2669Module augmentation declarations must be in a file that is recognized as an external module.
TS2856A @ts-check comment is used in a TypeScript file where it has no effect.
E0046Not all required methods of a trait are implemented.
E0053The method signature in an impl block does not match the trait's method signature.
E0277A type that does not implement Send is used in a context that requires thread-safety.
E0277A dynamically sized type (DST) is used where a Sized type is required.
E0277A type is used in a for loop or iterator context but does not implement Iterator.
E0308The closure returns a different type than expected by the context.
E0562The impl Trait syntax is used in a position where it is not allowed.
E0308The function returns a Result with the wrong Ok or Err type.
E0277A type is used as a callable but does not implement Fn, FnMut, or FnOnce.
clippy::map_unwrap_orUsing .map().unwrap_or() can be replaced with .map_or().
clippy::single_matchA match expression with only one meaningful arm can be simplified to an if let.
clippy::redundant_closureA closure that just calls a function can be replaced with the function itself.