Blank Page When Hosting React Vite TS Project on AWS Amplify #18064
-
I am trying to host my React app (using Vite and TypeScript) on AWS Amplify, but the page returns completely blank. After checking the browser's console, I noticed the following error:
The app works when I build and run it locally Here’s the amplify.yml configuration I’m using:
Any help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Fix: For those wondering: I had the same route in React Router pointing to different pages |
Beta Was this translation helpful? Give feedback.
Fix: For those wondering: I had the same route in React Router pointing to different pages
The issue occurred because I had a dynamic route like /:param, which conflicted with an existing sitemap.xml in my public folder. Since the dynamic route was catching all URLs, it intercepted also requests to /sitemap.xml and somehow caused this error.