简体   繁体   English

"类型上不存在属性“创建”"

[英]Property 'create' does not exist on type

I am trying to contact an API but when I use axios.create() I get an error saying:我正在尝试联系 API,但是当我使用axios.create()时,我收到一条错误消息:

Property 'create' does not exist on type 'typeof import("Stuff/Stuff/Stuff/My_app/Frontend/app/node_modules/axios/index")

Code:代码:

import axios from "axios";

//Error here:
axios.create({
baseURL:"http://MyFantasticAPI.com(Not a real api)"
});

Try尝试

const instance = axios.default.create({
    baseURL: 'http://MyFantasticAPI.,
  });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM