LoginSignup
0
0

More than 1 year has passed since last update.

Module parse failed: Unexpected string in JSON at position 93 while parsing と表示された時の対処

Posted at

jsonファイルを手動で弄ると起こるエラー

Module parse failed: Unexpected string in JSON at position 93 while parsing '{
  "name" : "text",
  "sex": {
    "'
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
SyntaxError: Unexpected string in JSON at position 93 while parsing '{...

このエラーが起こった時の対処です。

カンマ(,)が無かった

{
  "name" : "abc" 
  "sex": {
    "male": "true"
  } 
  "age": "123"
}

カンマ(,)が足りていなかっただけでした。
不必要な箇所にカンマがあっても同様のエラーが発生するようです。
簡単ですが、オブジェクトが長くなると見逃しがちです。

jsonエディターで解決

json用のeslintなど検証ツールが入っていれば悩まないはずですが、私はちょうど導入してなくてこのエラーが出ました。
そんな時はWebアプリのjsonエディターを使って解決しましょう。

これに入れると、エラー箇所を教えてくれるので解決です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0