Description
When starting the Vite dev server via lerd web ui, the @laravel/vite-plugin-wayfinder plugin fails immediately during its buildStart hook because the php binary is not available in the environment where the Vite process runs.
This works correctly when running npm run dev from a terminal that has php on its PATH.
Steps to reproduce
- Create a new Laravel project using the Vue starter kit:
laravel new myapp --using=laravel/vue-starter-kit
- Link the project with
lerd link (make sure Vite is checked).
- Observe the error in the linked site in the lerd UI.
Error output
Error: Error generating types: Error: Command failed: php artisan wayfinder:generate --with-form
/bin/sh: php: command not found
at PluginContext._formatLog (file:///Users/username/myapp/node_modules/vite/dist/node/chunks/node.js:30486:39)
at PluginContext.error (file:///Users/username/myapp/node_modules/vite/dist/node/chunks/node.js:30483:14)
at runCommand (file:///Users/username/myapp/node_modules/@laravel/vite-plugin-wayfinder/dist/index.mjs:2101:15)
at async Promise.all (index 2)
at async EnvironmentPluginContainer.hookParallel (file:///Users/username/myapp/node_modules/vite/dist/node/chunks/node.js:30130:3)
at async EnvironmentPluginContainer.buildStart (file:///Users/username/myapp/node_modules/vite/dist/node/chunks/node.js:30140:3)
at async file:///Users/username/myapp/node_modules/vite/dist/node/chunks/node.js:26358:41
at async httpServer.listen (file:///Users/username/myapp/node_modules/vite/dist/node/chunks/node.js:26369:5) {
plugin: '@laravel/vite-plugin-wayfinder'
}
Description
When starting the Vite dev server via
lerdweb ui, the@laravel/vite-plugin-wayfinderplugin fails immediately during itsbuildStarthook because thephpbinary is not available in the environment where the Vite process runs.This works correctly when running
npm run devfrom a terminal that hasphpon itsPATH.Steps to reproduce
lerd link(make sure Vite is checked).Error output