windmill-labs/windmill · warning
Using local PathScript files for flow preview. ${details.joi
Error message
Using local PathScript files for flow preview.
${details.join("\n")}
Use --remote to preview deployed workspace scripts instead. What it means
`warnAboutLocalPathScriptDivergence`, called during flow preview, tells the developer that flow preview is using locally edited PathScript files rather than the versions deployed in the workspace. It lists which scripts diverged (including ones missing from the workspace) and points to `--remote` to preview the deployed versions instead.
Source
Thrown at cli/src/commands/flow/flow.ts:136
}
const details: string[] = [];
if (divergence.changed.length > 0) {
details.push(
`These workspace scripts differ from the deployed version:\n${divergence.changed
.map((path) => `- ${path}`)
.join("\n")}`
);
}
if (divergence.missing.length > 0) {
details.push(
`These scripts do not exist in the workspace yet:\n${divergence.missing
.map((path) => `- ${path}`)
.join("\n")}`
);
}
log.warn(
`Using local PathScript files for flow preview.\n${details.join("\n")}\nUse --remote to preview deployed workspace scripts instead.`
);
}
const alreadySynced: string[] = [];
// Collect every script/sub-flow step path in a flow value — recursively through loops,
// branches, and the failure/preprocessor modules — for workspace-path validation. Unlike
// `collectPathScriptPaths` this also includes `type: "flow"` sub-flow steps.
function collectStepPaths(flowValue: any): string[] {
const paths: string[] = [];
const walk = (modules: any[] | undefined) => {
for (const m of modules ?? []) {
const v = m?.value;
if (!v) continue;
if ((v.type === "script" || v.type === "flow") && typeof v.path === "string") {
paths.push(v.path);
}View on GitHub (pinned to e474e8803c)
Solutions
- Push the local scripts so workspace matches local: `wmill script push` / `wmill sync push`.
- Preview deployed content instead: add `--remote` to the flow preview command.
- Regenerate the flow lock after syncing: `wmill flow generate-lock` (or `wmill generate-metadata`) to reconcile paths.
- Create the missing scripts in the workspace if they are genuinely absent.
Example fix
// before: preview diverges silently from deployed wmill flow preview my.flow.yaml // after: preview exactly what is deployed wmill flow preview my.flow.yaml --remote
Defensive patterns
Strategy: validation
Validate before calling
// before previewing, verify the referenced scripts exist in the workspace
import * as wmill from 'windmill-client';
for (const path of localPathScriptPaths) {
try { await wmill.getScriptByPath(path); }
catch { console.warn(`missing in workspace: ${path} — push it first`); }
} Type guard
null
Try / catch
null
Prevention
- Run `wmill sync push` before `wmill flow preview` after local edits.
- Use `--remote` whenever you intend to preview deployed behavior.
- Regenerate locks (`wmill generate-metadata`) after adding or moving PathScripts.
When it happens
Trigger: Running `wmill flow preview` (or `flow run --preview`) on a flow whose locked PathScript dependencies differ from workspace content — locally edited files, or scripts referenced by path that were never pushed (missing from the workspace), without the `--remote` flag.
Common situations: Developer edited a PathScript locally after the flow lock was generated; teammate pushed scripts the local checkout lacks; fresh clone where the flow is synced but its scripts were never synced; previewing before running `wmill sync push`.
Related errors
- App ${appPath} not found
- Dependency generation failed: ${queueResponse.status} ${queu
- Failed to poll dependencies job ${jobId}: ${e?.message ?? e}
- No response body for SSE stream
- Datatable '${dtName}' already exists in this workspace
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/e3d333d06bee3fd8.
Report an issue: GitHub.