codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.12k stars 2.29k forks source link

Axios get throwing error even when it shouldn't? #1781

Closed SumNeuron closed 4 years ago

SumNeuron commented 5 years ago

🐛 bug report

Description of the problem

How has this issue affected you? What are you trying to accomplish?

I am trying to test a light bundle which creates an axios instance as detailed in their docs. I have used this before without issue. The bundle did not work so to help debug I loaded the bundle source files under the directory assets/archidekt/

The sandbox can be found here: https://codesandbox.io/s/pyx14r6jpm?fontsize=14

See the component HelloWorld

So to make sure axios works at all I tried removing the instance and calling a link (which when posted in a browser works):


async go() {
...
 await axios.get("https://archidekt.com/api/decks/65126/small/");
}

and the error is

"createError@https://pyx14r6jpm.codesandbox.io/node_modules/axios/lib/core/createError.js:16:15
handleError@https://pyx14r6jpm.codesandbox.io/node_modules/axios/lib/adapters/xhr.js:87:14
"}

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox
Browser Mozilla latest
Operating System Ubuntu 16.94LTS / MacOS 14
lbogdan commented 5 years ago

@SumNeuron I'm not sure I get what's wrong, exactly. Can you please tell us what are you expecting to happen vs. what's actually happening?

SumNeuron commented 5 years ago

I also do not get what is wrong. I think it might be codesandbox specific... but for whatever reason, the rolluped axios instance doesnt work there :upside_down_face:

SaraVieira commented 4 years ago

Hey!

From what I tested this sandbox seems to be working

I will close this, please reopen if the issue persists

shide1989 commented 2 years ago

Had the same Issue but using an HTTP endpoint. And managed to Solve it by Enabling CORS on my server.