I installed this Drag and Drop plugin and tried to fetch my data from a local JSON file, however, I endeavoured an error: "Module build failed: SyntaxError: Unexpected token ] in JSON!" The JSON code I am using is down below.
{"games":[
{
"id":"1",
"name":"F5",
"link":"someLink",
"price":"50$"
},
{
"id":"2",
"name":"BnS",
"link":"someLink",
"price":"35$"
},
{
"id":"3",
"name":"WoW",
"link":"someLink",
"price":"55$"
},
]}
Where is the problem? Thanks in advance!
Your JSON is invalid. You can try this one:
{
"games": [{
"id": "1",
"name": "F5",
"link": "someLink",
"price": "50$"
},
{
"id": "2",
"name": "BnS",
"link": "someLink",
"price": "35$"
},
{
"id": "3",
"name": "WoW",
"link": "someLink",
"price": "55$"
}
]
}
Here's a useful tool for validating JSON, which I just utilised to fix your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With