Build consistently failing with stale file error after code fix (Node/pnpm/Vite)

boothsbychristy-ops
PRO

5 days ago

Hello, I am experiencing a persistent build failure on my Node/pnpm/Vite project (Empress-AI-Studio) deployed on Railway.

I have identified and fixed all code-related issues in my repository, but the deployment continues to fail with the exact same error, suggesting a caching issue.

Project Details:

  • Stack: Node.js (v22.x), pnpm, Vite (frontend), Express/esbuild (backend).

  • Error: The build fails during the Vite step with a syntax error in an old version of a file.

    Plain Text

    /app/client/src/App.tsx:1057:0: ERROR: Unexpected end of file
    
  • The Problem: This error was caused by a missing export default App; statement, which has been fixed and pushed to the main branch. However, the logs from the latest deployment attempts (after the fix) still show the error at the same line number, confirming the build is using a stale, cached version of the file.

  • Action Taken: I have pushed multiple commits to the repository, but the build environment does not seem to be pulling the latest code. I have tried manual redeploys.

My Question: How can I force a complete, non-cached rebuild on my Railway service to ensure it pulls the latest files from my GitHub repository? Is there a specific CLI command or a configuration setting I can use to guarantee a clean build environment?

Attachments

$10 Bounty

2 Replies

Railway
BOT

5 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


monuit
PROTop 5% Contributor

4 days ago

hey, to disable build layer caching, you need to do NO_CACHE=1 which is found in railway docs. also, make sure youre deploying with the latest code changes made available by hitting Ctrl K -> deploy Latest K which can also be found here


Loading...
Build consistently failing with stale file error after code fix (Node/pnpm/Vite) - Railway Help Station