Javascript エラーメッセージ集
javascriptで、エラーが発生する原因と解決方法を記載してます。エラーメッセージは使用しているブラウザにより異なる場合があります。ここでは主に「chrome」や「firefox」や「safari」の3つのブラウザを対象にしてます。
TypeError
- エラー「Uncaught TypeError: Cannot set property ‘xxx’ of undefined」が発生した場合
- エラー「Uncaught TypeError: Cannot read properties of null (reading ‘xxx’)」の解決方法
- エラー「Uncaught TypeError: Cannot read properties of undefined (reading ‘xxx’)」の解決方法
- エラー「TypeError: undefined is not an object (evaluating ‘arr[x].toString’)」の解決方法
- エラー「TypeError: JSON.stringify cannot serialize cyclic structures.」の解決方法
- エラー「Uncaught TypeError: Cannot add property xxx, object is not extensible」の解決方法
- エラー「Uncaught TypeError: xxx.toISOString is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.join is not a function」の解決方法
- エラー「Uncaught TypeError: Cannot write private member #xxx to an object whose class did not declare it」の解決方法
- エラー「Uncaught TypeError: xxx.contains is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.getMinutes is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.innerHTML is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.getElementsByName is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.addEventListener is not a function」の解決方法
- エラー「Uncaught TypeError: console.log(…) is not a function」の解決方法
- エラー「Uncaught TypeError: window[(xxx)] is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.setAttribute is not a function」の解決方法
- エラー「Uncaught TypeError: regex.test is not a function」の解決方法
- エラー「Uncaught TypeError: xxx(…).then is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.pop is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.findIndex is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.replace is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.startsWith is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.match is not a function」の解決方法
- エラー「Uncaught TypeError: xxxxx.unshift is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.replaceAll is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.substring is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.split is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.filter is not a function」の解決方法
- エラー「Uncaught TypeError: Do not know how to serialize a BigInt」の解決方法
- エラー「Uncaught TypeError: xxx.getElementsByTagName is not a function」の解決方法
- エラー「Uncaught TypeError: Cannot redefine property: xxx」の解決方法
- エラー「Uncaught TypeError: xxx.toUTCString is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.getBoundingClientRect is not a function」の解決方法
- エラー「Uncaught TypeError: Reduce of empty array with no initial value」の解決方法
- エラー「Uncaught TypeError: Converting circular structure to JSON」の解決方法
- エラー「Uncaught TypeError: Assignment to constant variable.」の原因
- エラー「Uncaught TypeError: window.location.href is not a function」の解決方法
- エラー「Uncaught TypeError: Cannot convert undefined or null to object」の解決方法
- エラー「Uncaught TypeError: Cannot use ‘in’ operator to search for ‘xxx’ in xxx」の解決方法
- エラー「Uncaught TypeError: Illegal invocation」がオブジェクトを変数代入時に発生した場合
- エラー「Uncaught TypeError: Cannot set property name of #object which has only a getter」が発生する原因と対処法
- エラー「Uncaught TypeError: xxxxx.get is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.toDateString is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.cloneNode is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.slice is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.push is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.length is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.map is not a function」の解決方法
- エラー「Uncaught TypeError: Cannot delete property ‘xxx’ of 」の解決方法
- エラー「Uncaught TypeError: xxx.includes is not a function」の解決方法
- エラー「Uncaught TypeError: Date(…).getFullYear is not a function」の解決方法
- エラー「Uncaught TypeError: Cannot convert a BigInt value to a number」の解決方法
- エラー「TypeError: Argument 1 (‘child’) to Node.removeChild must be an instance of Node」の解決方法
- エラー「Uncaught TypeError: Failed to execute ‘removeChild’ on ‘Node’: parameter 1 is not of type ‘Node’.」の解決方法
- エラー「Uncaught TypeError: callback is not a function」の解決方法
- エラー「TypeError: “xxx” is not an Object. (evaluating ‘”x” in “xxx”‘)」の解決方法
- エラー「typeError: Attempted to assign to readonly property.」の解決方法
- エラー「TypeError: Attempted to assign to readonly property.」の解決方法 2
- エラー「Uncaught TypeError: Promise.resolve is not a constructor」の解決方法
- エラー「TypeError: reduce of empty array with no initial value」の解決方法
- エラー「TypeError: Array.prototype.sort requires the comparator argument to be a function or undefined」の解決方法
- エラー「Uncaught TypeError: xxx.getContext is not a function」の解決方法
- エラー「TypeError: null is not an object (evaluating ‘xxx.value’)」の解決方法
- エラー「Uncaught TypeError: xxx must be called on a function」の解決方法
- エラー「Uncaught TypeError: Promise.reject is not a constructor」の解決方法
- エラー「Uncaught TypeError: The comparison function must be either a function or undefined」の解決方法
- エラー「Uncaught TypeError: xxx.concat is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.toLocaleDateString is not a function」の解決方法
- エラー「Uncaught TypeError: xxxxx.has is not a function」の解決方法
- エラー「Uncaught TypeError: Cannot set property ‘innerHTML’ of null」が発生した場合の対処法
- エラー「Uncaught TypeError: xxx.toFixed is not a function」が発生した場合の対処法
- エラー「Uncaught TypeError: xxx.trim is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.appendChild is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.animate is not a function」の解決方法
- エラー「Uncaught TypeError: Failed to execute ‘setStart’ on ‘Range’: parameter 1 is not of type ‘Node’.」が発生した場合の対処法
- エラー「Uncaught TypeError: Failed to execute ‘setAttribute’ on ‘Element’: 2 arguments required, but only 1 present.」の解決方法
- エラー「Uncaught TypeError: Iterator value xxx is not an entry object」の解決方法
- エラー「TypeError: undefined is not a function (near ‘…x of xxx…’)」の解決方法
- エラー「TypeError: Unable to delete property.」の解決方法
- エラー「TypeError: Attempting to change configurable attribute of unconfigurable property.」の解決方法
- エラー「TypeError: |this| is not a function inside Function.prototype.bind」の解決方法
- エラー「Uncaught TypeError: Object prototype may only be an Object or null: undefined」の解決方法
- エラー「Uncaught TypeError: xxx is not a constructor」の解決方法
- エラー「Uncaught TypeError: xxx.format is not a function」の解決方法
- エラー「Uncaught TypeError: Right-hand side of ‘instanceof’ is not an object」の解決方法
- エラー「Uncaught TypeError: Cannot mix BigInt and other types, use explicit conversions」の解決方法
- エラー「TypeError: Invalid mix of BigInt and other type in addition.」の解決方法
- エラー「TypeError: Can only call Document.write on instances of Document」の解決方法
- エラー「Uncaught TypeError: Failed to execute ‘readAsText’ on ‘FileReader’: parameter 1 is not of type ‘Blob’.」が発生した場合の解決方法
- エラー「Uncaught TypeError: Constructor Map requires ‘new’」の解決方法
- エラー「Uncaught TypeError: String.prototype.matchAll called with a non-global RegExp argument」の解決方法
- エラー「Uncaught TypeError: xxx.padStart is not a function」の解決方法
- エラー「Uncaught TypeError: xxx.splice is not a function」の解決方法
- エラー「Uncaught TypeError: document.documentElement.webkitRequestFullscreen is not a function」が発生した場合の解決方法
- エラー「TypeError: Argument 1 (‘blob’) to FileReader.readAsText must be an instance of Blob」の解決方法
- エラー「Uncaught TypeError: Failed to resolve module specifier “xxx.js”. Relative references must start with either “/”, “./”, or “../”.」の解決方法
- エラー「Uncaught TypeError: Cannot destructure property ‘xxx’ of ‘undefined’ as it is undefined.」の解決方法
ReferenceError
- アロー関数でエラー「Uncaught ReferenceError: arguments is not defined」が発生
- エラー「Uncaught ReferenceError: xxx is not defined」の解決方法
- エラー「Uncaught ReferenceError: Must call super constructor in derived class before accessing ‘this’ or returning from derived constructor」の解決方法
- エラー「ReferenceError: Cannot access uninitialized variable.」の解決方法
- エラー「Uncaught ReferenceError: Cannot access ‘xxx’ before initialization」の解決方法
- エラー「Uncaught ReferenceError: key is not defined」の解決方法
- エラー「ReferenceError: Can’t find variable: key」の解決方法
- エラー「ReferenceError: ‘super()’ must be called in derived constructor before accessing |this| or returning non-object.」の解決方法
- エラー「Uncaught ReferenceError: Invalid left-hand side expression in prefix operation」の解決方法
- エラー「ReferenceError: Can’t find variable: moment」の解決方法
- エラー「Uncaught ReferenceError: infinity is not defined」の解決方法
- エラー「Uncaught ReferenceError: True is not defined」の解決方法
SyntaxError
- エラー「Uncaught SyntaxError: Missing initializer in const declaration」の解決方法
- エラー「Uncaught SyntaxError: missing ) after argument list」の解決方法
- エラー「Uncaught SyntaxError: Unexpected end of input」の解決方法
- エラー「Uncaught SyntaxError: Unexpected identifier」の解決方法
- エラー「Uncaught SyntaxError: Unexpected string」の解決方法
- エラー「Uncaught SyntaxError: Unexpected token ‘default’」の解決方法
- エラー「SyntaxError: Unexpected number ‘xxx’. Expected an opening ‘{‘ at the start of a function body.」の解決方法
- エラー「Uncaught SyntaxError: Unexpected end of JSON input」の解決方法
- エラー「SyntaxError: Cannot use the reserved word ‘xxx’ as a lexical variable name in strict mode.」の解決方法
- エラー「Uncaught SyntaxError: The requested module ‘xxx.js’ does not provide an export named ‘xxx’」の解決方法
- エラー「SyntaxError: Unexpected token ‘,’. Expected an opening ‘(‘ before a function’s parameter list.」の解決方法
- エラー「SyntaxError: Cannot delete unqualified property ‘x’ in strict mode.」の解決方法
- エラー「SyntaxError: Unexpected token ‘=’. Expected a ‘:’ following the property name ‘key’.」の解決方法
- エラー「SyntaxError: Unexpected string literal “xxx”. Expected a parameter pattern or a ‘)’ in parameter list.」の解決方法
- エラー「SyntaxError: Unexpected token o in JSON at position 1」の解決方法
- エラー「Uncaught SyntaxError: xxx is disallowed as a lexically bound name」の解決方法
- エラー「SyntaxError: Invalid character ‘\u201c’」の解決方法
- エラー「Uncaught SyntaxError: Private field ‘#x’ must be declared in an enclosing class」の解決方法
- エラー「Uncaught SyntaxError: Invalid or unexpected token」の解決方法
- エラー「Uncaught SyntaxError: Unexpected token ‘…’」の解決方法
- エラー「Uncaught SyntaxError: Unexpected token ‘,’」の解決方法
- エラー「Uncaught SyntaxError: Unexpected token ‘<‘」の解決方法
- エラー「SyntaxError: Decimal integer literals with a leading zero are forbidden in strict mode」の解決方法
- エラー「SyntaxError: The string did not match the expected pattern.」の解決方法
- エラー「Uncaught SyntaxError: Identifier ‘top’ has already been declared」の原因
- エラー「Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules」の解決方法
- エラー「Uncaught SyntaxError: for-in loop variable declaration may not have an initializer.」の解決方法
- エラー「SyntaxError: Unexpected token ‘;’. const declared variable ‘xxx’ must have an initializer.」の解決方法
- エラー「Uncaught SyntaxError: Strict mode code may not include a with statement」の解決方法
- エラー「SyntaxError: JSON Parse error: Property name must be a string literal」の解決方法
- エラー「Uncaught SyntaxError: Illegal return statement」の解決方法
- エラー「Uncaught SyntaxError: Unexpected number」の解決方法
- エラー「Uncaught SyntaxError: Delete of an unqualified identifier in strict mode.」の解決方法
- エラー「SyntaxError: ‘break’ is only valid inside a switch or loop statement.」の解決方法
- エラー「Uncaught SyntaxError: Invalid regular expression flags」の解決方法
- エラー「SyntaxError: Unexpected end of script」の解決方法
- エラー「SyntaxError: Function statements must have a name.」の解決方法
- エラー「Uncaught SyntaxError: Unexpected strict mode reserved word」の解決方法
- エラー「SyntaxError: Unexpected EOF」の解決方法
- エラー「SyntaxError: ‘with’ statements are not valid in strict mode.」の解決方法
- エラー「SyntaxError: Left hand side of operator ‘=’ must be a reference.」の解決方法
- エラー「SyntaxError: Return statements are only valid inside functions.」の解決方法
- エラー「Uncaught SyntaxError: Function statements require a function name」の解決方法
- エラー「SyntaxError: Unexpected token ‘x’. Expected an identifier as property name.」の解決方法
- エラー「Uncaught SyntaxError: Rest element must be last element」の解決方法
- エラー「Uncaught SyntaxError: Octal literals are not allowed in strict mode」の解決方法
- エラー「Uncaught SyntaxError: Invalid shorthand property initializer」の解決方法
- エラー「Uncaught SyntaxError: Invalid left-hand side in assignment」の解決方法
- エラー「SyntaxError: Unexpected keyword ‘xxx’. Cannot use ‘xxx’ as an identifier name for a LexicalDeclaration.」の解決方法
- エラー「SyntaxError: Unexpected token ‘}’. Expected either a closing ‘]’ or a ‘,’ following an array element.」の解決方法
- エラー「SyntaxError: Unexpected token ‘,’. Expected a closing ‘]’ following a rest element destructuring pattern.」の解決方法
- エラー「SyntaxError: JSON Parse error: Unexpected identifier “object”」の解決方法
- エラー「Uncaught SyntaxError: Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence」の解決方法
- エラー「Uncaught SyntaxError: Invalid destructuring assignment target」の解決方法
- エラー「SyntaxError: Unexpected token ‘**’. Ambiguous unary expression in the left hand side of the exponentiation expression; parentheses must be used to disambiguate the expression.」の解決方法
RangeError
- エラー「Uncaught RangeError: toPrecision() argument must be between 1 and 100」の解決方法
- エラー「Uncaught RangeError: toString() radix argument must be between 2 and 36」の解決方法
- エラー「RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity」の解決方法
- エラー「Uncaught RangeError: Invalid code point xxx」の解決方法
- エラー「Uncaught RangeError: Invalid count value」の解決方法
- エラー「RangeError: Arguments contain a value that is out of range of code points」の解決方法
- エラー「Uncaught RangeError: toExponential() argument must be between 0 and 100」の解決方法
- エラー「Uncaught RangeError: Maximum call stack size exceeded」が発生する原因と対処法
- エラー「Uncaught RangeError: Invalid array length」の解決方法
URIError
その他
- document referrerが取得できない
- 「map使用時に値がundefinedになる」の解決方法
- エラー「Uncaught DOMException: Failed to execute ‘querySelectorAll’ on ‘Document’: ‘a[href^=#]’ is not a valid selector.」の解決方法
- エラー「Uncaught DOMException: Failed to execute ‘replace’ on ‘DOMTokenList’: The token provided (‘xxx yyy’) contains HTML space characters, which are not valid in tokens.」の解決方法
- エラー「Uncaught DOMException: Failed to execute ‘btoa’ on ‘Window’: The string to be encoded contains characters outside of the Latin1 range.」の解決方法
- エラー「Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “application/json”. Strict MIME type checking is enforced for module scripts per HTML spec.」の解決方法
- エラー「QuotaExceededError: The quota has been exceeded.」の解決方法
- エラー「InvalidCharacterError: The string contains invalid characters.」の解決方法
- Microsoft Edgeでwindow . open実行時に「未定義のエラーです。」が発生した場合の対処法
- style.displayが反映されない
- removeEventListenerが効かない場合
- addEventListenerが効かない場合
- onsubmitが効かない
- removeが効かない
- onblurイベントが発火しない
- テキストフォームの値がundefinedになって取得できない
- Date使用時に「Invalid Date」が発生した場合の解決方法
- 三項演算子でreturn使用時にエラー「Uncaught SyntaxError: Unexpected token ‘return’」の解決方法
- split使用時にスラッシュ「r」が残る