Hi!
I’m working on moving a Redwood v6.6.0 application from Vercel to AWS via Flightcontrol and am running into a React Minified Error #130 only when deployed on non-index, non-errorful routes, e.g:
'/' # Resolves Home page
'/not-a-real-route' # Resolves 404 page
'/private-route' # Resolves private route OR fallback
'/fallback' # Fatal Error -- only works inside a private set
'/about' # Fatal Error
'/sso-callback' # Fatal Error
...
There are no network errors, but on these fatal error pages it looks like the HomePage React element is being loaded (as opposed to the correct page, e.g. AboutPage.js
). This only happens when deploying to S3 with Flightcontrol, local rw build && rw serve
works as expected.
I believe the 200 SPA redirect is working since I’m not getting the 404, just the wrong page and then a fatal error. It could possibly be something to do with how “MainLayout” is written, but I cannot reproduce this outside of AWS.
I was hoping that I’m missing something obvious that somebody can point out, here’s my Routes, but let know if there is anything else I can provide for debugging.
import { Router, Route, Set, PrivateSet } from '@redwoodjs/router'
import { useAuth } from './auth'
import MainLayout from './layouts/MainLayout/MainLayout'
const Routes = () => {
return (
<Router useAuth={useAuth}>
<Set wrap={MainLayout}>
{/* This works */}
<Route path="/" page={HomePage} name="home" prerender />
{/* These do not work */}
<Route path="/login" page={LoginPage} name="login" />
<Route path="/users" page={UsersPage} name="users" />
<Route path="/about" page={AboutPage} name="about" />
<Route path="/sso-callback" page={SSOCallbackPage} name="ssoCallback" />
{/* This works */}
<PrivateSet unauthenticated="login">
<Route path="/account" page={AccountPage} name="account" />
</PrivateSet>
</Set>
<Route notfound page={NotFoundPage} prerender />
</Router>
)
}
export default Routes