Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Solution for advice generator

@azammustafa66

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

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

@desalegn12

Posted

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 helpful

1

@azammustafa66

Posted

Thank you so much Desalegn I'm thinking to use parcel/webpack. @desalegn12

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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