2 months ago
I'm facing a stale build cache issue on my service. My latest commits to frontend/src/config/api.js are not being reflected in the deployed application, even after making new commits and triggering redeploys.
Project ID: 66ac5949-c473-4020-9df2-c6746890ad32
Service Name: Backend (This service builds both the Python backend and the React frontend via a multi-stage Dockerfile).
My frontend code is making an API call to an old, incorrect URL (http://localhost:5000 # Or whatever… ).
I have already fixed this in my code in the file frontend/src/config/api.js and pushed the commit to GitHub. The file on the main branch is correct.
However, the deployed application is still serving the old JavaScript file containing the broken URL. This is confirmed by the error message in the browser console.
Error: Failed to execute 'fetch' on 'Window': Failed to parse URL from http://localhost:5000 # Or whatever port your local backend runs on/api/learners/1/sessions
Is there a way to force a clear of the build cache for my service or any other way to ensure the npm run build step uses the latest committed code?
0 Replies
2 months ago
I may be mistaken, but aren't you the same user who had the same problem but for the front-end, and the issue was that you were committing your built folder to GitHub?
Yes that was definitely me. You were 100% right. I'm new to this and didn't realize the problem was a misplaced .gitignore file at the root of my project, which was causing the same symptoms as a committed build folder. I've fixed that now. Thanks again for your help, it pointed me directly to the solution!
2 months ago
Awesome, glad I could inadvertently help!
2 months ago
!s
Status changed to Solved brody • about 2 months ago