I'm getting this error when I try to use get method in Axios:
undefined is not an object (evaluating '_axios.axios.get')
How to solve this issue?
You should provide more of your code. And this code works for me:
import axios from 'axios';
axios.defaults.baseURL = [Input Your Base URL Here];
axios.get('/').then(function (response) {
console.log(response);
}).catch(function (error) {
console.log(error);
});
check your package.json also, and run npm install if you haven't.
...
"dependencies": {
"axios": "^0.18.0",
...