I'm facing an issue when scaling my application in a Kubernetes cluster. With 2 backend replicas and 1 frontend replica, everything works fine. However, when I scale to 2 frontend replicas, the page goes blank, and some React chunks, along with other components, return a 504 (Gateway Timeout) error.
Interestingly, all the errors are related to files inside the node_modules/.vite/deps directory, but many other components from the same directory load and work without any issues.
Has anyone encountered this problem before and found a solution or any direction to investigate?