Design comparison
Solution retrospective
The solution is working locally but on GitHub pages it shows this error:
Uncaught TypeError: Failed to resolve module specifier "axios". Relative references must start with either "/", "./", or "../".
Community feedback
- @desalegn12Posted over 1 year ago
actually, the error comes from Axios package is not installed from this project as a dependency. so to use Axios you need npm, package.json, or yarn, all in all, any package manager. here is the solution : window.onload = async function () { let advices = await fetch("https://api.adviceslip.com/advice"); advices = await advices.json();
const { slip: { advice, id }, } = advices; //here you can insert id and advice your appropriate place } }
Have fun!
Marked as helpful1@azammustafa66Posted over 1 year agoThank you so much Desalegn I'm thinking to use parcel/webpack. @desalegn12
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord