Laravel Reverb in Production getting error "Uncaught You must pass your app key when you instantiate Pusher."
I am using Laravel 11 with Vue js.
My project locally runs fine. but when the project uploads on shared hosting getting this error
"Uncaught You must pass your app key when you instantiate Pusher."
I had the same issue: the application would run just fine locally but gave that error on the production server. For production we have a ci/cd script that does stuff including copying files and at some point it runs npm run build.
My issue was that the .env file was not copied yet at the time npm run build was run. So the solution was to copy .env first, then npm run build.