1
I am getting the following error on my terminal when trying to compile React
./src/pages/main/index.js Line 3: 'api' is defined but never used no-unused-var
Follows the code:
import axios from 'axios';
const api = axios.create({
baseURL: 'https://jsonplaceholder.typicode.com/posts'
});
export default api;
Is error or Warning?
– Felipe Avelar
Compiled with warnings. . /src/pages/main/index.js Line 3: 'api' is defined but Never used no-unused-vars Search for the Keywords to Learn more about each Warning. To ignore, add // Eslint-disable-next-line to the line before.
– João Filipe
A Warning, I’m sorry.
– João Filipe
The problem is that it does not boot the server.
– João Filipe
But it gives build failed?
– Felipe Avelar
I see no problem in your code, as you are using in import? For your metro bundler, check your code and start all over again.
– Marconi
That’s a Warning, not a mistake.
– Giuliana Bezerra
Where are you calling the variable
api
? Warning says it is set but is never called.– sant0will