Time-tracking-dashboard | Pixel perfect | Responsive | Sass
Design comparison
Solution retrospective
Most proud that i`ve made almost pixel perfect responsive dashboard, using SCSS btw it is my first usage with it and i freaking loved it
What challenges did you encounter, and how did you overcome them?Challange one , when i fetch data from data.json for some reason i`ve got error, by inspecting it for some reason data.json file reads like html i did some digging using chatgpt but couldnt find solution , path of file is not a problem (I THINK XD) PLEASE help me with this someone
What specific areas of your project would you like help with?Data.json reads as html document for some reason
Community feedback
- @webdevbynightPosted 23 days ago
To try to resolve your bug with the loading of
data.json
, since, when previewing your page, the console tells it failed to load the resource and the server responded with a 404 status, you should try to contact the support at Netlify or to check if Netlify accepts JSON files and API fetching with relative URLs.When fetching JSON data, you should check if the response returned by the Fetch API does not include a 404 status or a
ok
property set tofalse
before returning the response, like this:fetch("./js/data.json") .then((response) => { if (!response.ok || response.status !== 200) throw new Error(`Status error: ${response.status}`); return response.json(); }) .catch((error) => console.error(error.message));
By the way, if it is fine to use
.then()
and.catch()
methods, you can useasync
/await
(have a look at my solution to see how to use).I hope this helps you.
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