You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I have a React app that uses the first slug in the URL as a query param for an api call. I'm getting 404 error in console and the React app loads afterwards because it can't find the path or directory before index.html is loaded (that's my guess).
Again, the react app loads but I'm trying to get rid of the 404 error in console.
There's a proxy to redirects "/images" requests to s3/cloudfront bucket.
I added console.log in index.html and it's trying to access the directory first (erring in 404) before loading index.html...
Any suggestions on how to get around this? Or if this is impossible to do.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there,
I have a React app that uses the first slug in the URL as a query param for an api call. I'm getting 404 error in console and the React app loads afterwards because it can't find the path or directory before index.html is loaded (that's my guess).
Again, the react app loads but I'm trying to get rid of the 404 error in console.
My setup: React router dom- 6.26.2, React 18.3.1
URL example: http://www.somesite.com/company-name where company-name is passed as query param to a rest call.
In App.tsx:
<Route path="/" element={} />
<Route path="/:companyName/" element={} />
<Route path="" element={} />
hosting on AWS Amplify
There's a proxy to redirects "/images" requests to s3/cloudfront bucket.
I added console.log in index.html and it's trying to access the directory first (erring in 404) before loading index.html...
Any suggestions on how to get around this? Or if this is impossible to do.
Beta Was this translation helpful? Give feedback.
All reactions