[Vite + Nitro] Workflow HMR not working — file changes not picked up in dev and slow rebuilding
Environment
| Package |
Version |
workflow |
4.4.0 |
@workflow/nitro |
4.1.0 |
@workflow/vite |
4.0.9 |
@workflow/builders |
4.0.10 |
nitro |
3.0.260610-beta |
vite |
8.0.16 |
| Node |
24.15.0 |
| OS |
macOS (darwin) |
Bug description
When using the recommended Vite + Nitro setup per the docs, editing a workflow file (containing "use workflow" / "use step" directives) does not trigger a rebuild of the workflow bundles. The dev server continues serving the stale version. Only a full restart picks up changes. Regular API route HMR (non-workflow files) works fine via Nitro's Vite environment.
Also the terminal says it is rebuilding (which takes around 8000 ms) and succeed, but still a console.log stays the same (old value) within a step for example.
Steps to reproduce
- Set up a Vite + Nitro project per the docs:
// vite.config.ts
import { nitro } from "nitro/vite";
import { defineConfig } from "vite";
import { workflow } from "workflow/vite";
export default defineConfig({
plugins: [
nitro({
serverDir: "./src",
}),
workflow({ dirs: ["./src/workflows"] }),
],
resolve: { tsconfigPaths: true },
});
- Create a workflow file with "use workflow" and "use step" directives
- Run vite (dev server)
- Edit the workflow file (e.g. add a console.log inside a step)
- Trigger the workflow — the old version still runs
Summary
We have two problems, HMR is not working and rebuilding is very slow. I am not sure how to rexolve those and can't find any other tickets about this.
[Vite + Nitro] Workflow HMR not working — file changes not picked up in dev and slow rebuilding
Environment
workflow@workflow/nitro@workflow/vite@workflow/buildersnitroviteBug description
When using the recommended Vite + Nitro setup per the docs, editing a workflow file (containing
"use workflow"/"use step"directives) does not trigger a rebuild of the workflow bundles. The dev server continues serving the stale version. Only a full restart picks up changes. Regular API route HMR (non-workflow files) works fine via Nitro's Vite environment.Also the terminal says it is rebuilding (which takes around 8000 ms) and succeed, but still a console.log stays the same (old value) within a step for example.
Steps to reproduce
Summary
We have two problems, HMR is not working and rebuilding is very slow. I am not sure how to rexolve those and can't find any other tickets about this.