Hi folks!
I’m relatively new to Netlify and I’m a junior developer who’s facing the following issue when deploying my website: I’m using a JSON file, mapping through its content and rendering the information on a specific page of my website. I recently needed to update the content of this JSON file and its new content gets rendered on my local server, however, when I deploy the website to Netlify, I keep seeing the previous content. Any idea why this might happening?
To provide more context, I’m using Astro website builder and my members.json file is located in a _ folder, which in turn is placed inside the “Public” folder.
This is how I’m fetching my data:
const membersJSON = await fetch(new URL('/_/members.json', Astro.url).href).then((response) => response.json())
const teamMembers = JSON.stringify(membersJSON) || {};
And here’s a snippet of the code I have inside members.json (removed real content for privacy):
{
“member-a: {
"name": “lorem” ipsum,
"position": “CEO”,
"bio": "<p>Lorem ipsum…</p>",
"social": {
"linkedin": "https://www.linkedin.com/in/…/“,
"twitter": false
},
"photo": {
"src": "/imgs/members/member-a.jpg",
"alt": [
“member-a.jpg"
]
}
},
“member-b”: {
"name": “lorem “ipsum,
"position": "CFO”,
"bio": "<p>Lorem ipsum…</p>",
"social": {
"linkedin": false,
"twitter": false
},
"photo": {
"src": "/imgs/members/member-b.jpg",
"alt": [
“member-b.jpg"
]
}
},
}
When I check the network and the console tabs in the developers tool on the deployed site, I can’t see any errors.
Does anyone have a suggestion regarding what may be causing this? I’ve been trying to solve this for 2 days now to no avail and thus would highly appreciate any guidance from more experienced developers.
Many thanks in advance!