Good afternoon, I've been trying to find the problem for a whole day and I could not get the following error:
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
I have searched in other forums but some recommend that it may be a problem of the Json file because of the syntax, but I have already validated it in link and not present no problem . I'm using React, what could be the error and how could I fix it?
This is my Json File:
[
{
"name": "Enrique"
},
{
"name": "Camilo"
},
{
"name": "Alex"
},
{
"name": "Artemo"
}
]
I'm using Fetch I leave the code:
componentDidMount: function() {
fetch('json/users.json')
.then(userJson => userJson.json(), e => {
console.log("Obtención fallida", e);
})
.then(userJson => {
console.log(userJson);
});
},