Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

P-James's avatar
Level 12

ASSET_URL not defined in Vapor js

My set up is: Laravel Vapor, Inertia and Vue, and using Sidecar to handle SSR requests in a lambda function. I've got it all set up working. My problem is the process.env.MIX_VAPOR_ASSET_URL is undefined in my production environment. It works in my staging environment. The only differences between these environments are

  1. The package.json script to compile: pnpm exec mix --mix-config=webpack.ssr.mix.js --production
  2. the domain in vapor.yml

I think the problem is the output of the --production script. I have tried moving laravel-vapor from devDepencies to depencies but that hasn't helped.

Has anyone faced a similar problem?

I am using laravel-vapor via a composable like so:

import Vapor from 'laravel-vapor'

export const useAsset = (path) => Vapor.asset(path)
0 likes
0 replies

Please or to participate in this conversation.