Syntaxerror: JSON.parse: Unexpected Character at line 1 column 1 of the JSON data - Nodejs vueJS

Asked

Viewed 65 times

1

I am using an application with vuejs and Node, and I need to get information through a . json, but when making the request I get the following error:

Syntaxerror: JSON.parse: Unexpected Character at line 1 column 1 of the JSON data

My Json is correct, follow the code:

getCars(){

        fetch('../data/carros.json')
        .then(resp => resp.json())
        .then(data => console.log(data));
        }
    },

    mounted(){
       this.getCars();
}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.