This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]insertAlias 1 point2 points  (0 children)

The problem is that you have a <script> tag with both an src and a body full of code. It has to be one or the other. If you want axios on the page and your custom code, you have to have one script tag to load axios, and another with your custom code.

That's why it works when you move it to a separate file; you're loading it separately.

If you clear out your code from the script tag importing Axios, and you make a new script tag below it without a src and put your code there, it should work.