May 10, 2022
0
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
- The package.json script to compile:
pnpm exec mix --mix-config=webpack.ssr.mix.js --production - 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)
Please or to participate in this conversation.