For anyone who lands here having the same problem - OP's issue was a year ago so I'd imagine he got to the bottom of it - but I experienced the same thing.
Short Answer
Add the following line to your environment variables in Vapor (e.g. .env.staging file) and redeploy
SESSION_DRIVER=dynamodb
Long Answer
-
Validation errors are flashed to the session, and then InertiaJS shares them
-
On your local machine, Laravel likely uses the 'file' driver, and this is probably the default case on Vapor too
-
Sessions used to be stored in a file when you had only one server to think of. As soon as you start building distributed applications (which a Vapor-powered application is) you are dealing with load balancing across many servers. The validation errors would be flashed to a session file on the server that the initial POST request went to - but there is no guarantee that the subsequent GET request triggered by Inertia will go to the same server (Lambda host container in this case) and in that case, the data will not be on the server.
-
Resolve this by creating a central store for your session data - e.g. a Database, Cache, etc...
-
In my case, my application didn't need a database so I just used the DynamoDB driver