I’m using PHP deployer to deploy my React + Laravel app.
This issue I’m having is the .env variables loaded by this part of bootstrap.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.PUSHER_APP_KEY,
wsHost: import.meta.env.PUSHER_HOST ? import.meta.env.PUSHER_HOST : `ws-${import.meta.env.PUSHER_APP_CLUSTER}.pusher.com`,
wsPort: import.meta.env.PUSHER_PORT ?? 80,
wssPort: import.meta.env.PUSHER_PORT ?? 443,
forceTLS: (import.meta.env.PUSHER_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
disableStats: true,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
auth: {
headers: {
authorization: 'Bearer ',
}
}
});
works great locally but when I deploy with this recipe
task('npm:install', function () {
run('cd {{release_path}} && npm install');
});
task('npm:build', function () {
run('cd {{release_path}} && npm run build');
});
after('deploy:update_code', 'npm:install');
after('npm:install', 'npm:build');
results in this on the server.
window.Echo = new Gk({
broadcaster: "pusher",
key: {}.VITE_PUSHER_APP_KEY,
wsHost: {}.VITE_PUSHER_HOST ? {}.VITE_PUSHER_HOST : `ws-${{}.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
wsPort: {}.VITE_PUSHER_PORT ?? 80,
wssPort: {}.VITE_PUSHER_PORT ?? 443,
forceTLS: ({}.VITE_PUSHER_SCHEME ?? "https") === "https",
enabledTransports: ["ws", "wss"],
disableStats: !0,
cluster: {}.VITE_PUSHER_APP_CLUSTER,
auth: { headers: { authorization: "Bearer " } }
});
Anyone have any idea why I’m getting this?