Skip to content

Start the Vite dev server for PHP/Laravel sites (Inertia, laravel-vite-plugin) #201

In review

Description

@mathieutu

Problem

A Laravel app that uses Vite (Inertia + Vue/React/Svelte, or any app using laravel-vite-plugin) cannot render its pages until a Vite dev server is running (or vite build has been run). The Blade @vite directive looks for public/hot or public/build/manifest.json, and fails with "Unable to locate file in Vite manifest" when neither exists.

Flock serves the PHP side (FrankenPHP / PHP-FPM) but does not start Vite for these projects. Today the developer has to remember to run yarn dev / npm run dev in a separate terminal, which is not the "it just works" experience Flock gives for the rest of the stack.

What exists today

flock type --help says a Node.js app's dev server (npm run dev) is started when the site is first visited. That only applies to sites detected as Node.js (a package.json with a dev script and nothing PHP). A Laravel project is detected as PHP, so its dev script is never run. #97 covers the Node-only case; I could not find an issue about PHP sites that also need a frontend dev server.

Proposal

For a PHP/Laravel site that has a package.json with a dev script and a Vite config, let Flock start that dev script alongside the site, the same way it already does for Node.js sites (started on first visit, with the project's Node.js version, stopped with the site). Possible shapes:

  • automatic when vite.config.* and laravel-vite-plugin are detected;
  • or opt-in, for example flock dev start / a per-site setting / a key in .flockrc, if auto-starting a process is considered too surprising.

Points to keep in mind:

  • Vite writes public/hot, so the port it picks must be the one Flock reports; a fixed server.port in vite.config.* should be respected.
  • Projects that already run Vite themselves (composer run dev) must not end up with two servers fighting for the port.

Environment

  • Flock 1.1.0-beta.2
  • macOS
  • Laravel 13, laravel-vite-plugin, Inertia v3 (Vue)

Happy to propose a draft PR for this if the direction sounds right.

Activity

  1. lukas-frey commented on Nov 23, 2026

    @lukas-frey
    Member

    I'm not against it, but it needs a sleep mechanism, similar to the nodejs apps. If the app is inactive for 30+ minutes, the dev server needs to stop. After the website is visited, it should automatically start again. Otherwise flock would start eating up a lot of resources for no reason.

  2. added
    help wanted
    and removed on Nov 23, 2026
  3. added this to the v1.x milestone on Nov 23, 2026
  4. added a commit that references this issue on Nov 23, 2026
    b2b08d6
  5. github-actions commented on Nov 23, 2026

    @github-actions

    Issue claimed by @mathieutu in PR #202.

  6. added
    claimed
    and removed
    help wanted
    on Nov 23, 2026
  7. removed this from the v1.x milestone on Nov 23, 2026
  8. changed the title [-]Feature request: start the Vite dev server for PHP/Laravel sites (Inertia, laravel-vite-plugin)[/-] [+]Start the Vite dev server for PHP/Laravel sites (Inertia, laravel-vite-plugin)[/+] on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

claimed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions