cloudflare / cloudflare/cloudflare-os

workshop-frontend build cannot run its clean task on Windows

Open Beginner friendly
#250 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
9.9k
Forks
1.2k
Avg merge
1d 20h
Merged PRs (30d)
107

Description

## Summary

On Windows, the `workshop-frontend` Vite+ build task cannot get past its `clean:dist` dependency because that task asks Vite+ to execute the POSIX `rm` binary directly.

This also prevents the repository's required `pnpm lint` command from completing on Windows.

## Reproduction

At `3562627` on Windows 11, Node 24.19.0, and pnpm 11.17.0:

```text
> pnpm exec vp run -F @gadgets/workshop-frontend --no-cache build

error: Failed to find executable rm under cwd \packages\workshop-frontend
* cannot find binary path
```

The same failure occurs when the frontend task is reached through `pnpm lint`.

## Cause

#212 added this Vite+ task:

```ts
'clean:dist': { command: 'rm -rf dist', cache: false },
```

Vite+ resolves the task command as an executable, and a normal Windows environment has no `rm` binary. The older `clean` package scripts are different: package-manager scripts go through their platform shell, while this task is launched by Vite+ directly.

## Verified fix

Using Node's built-in filesystem API preserves the recursive, missing-path-tolerant cleanup without requiring a platform-specific executable:

```ts
command: `node -e "require('node:fs').rmSync('dist', { recursive: true, force: true })"`,
```

With that change on the same checkout:

- the targeted frontend build completed, including both TypeScript checks and the production Vite bundle;
- a stale sentinel placed under `dist/` before the run was removed by `clean:dist`;
- the full `pnpm lint` command completed successfully (existing warnings only).

AI tools assisted the investigation and drafting. The failure and verification results above were reproduced locally.

Contributor guide

Open the contributing guide

Research direction

Locate the workshop-frontend Vite+ configuration containing the clean:dist task and reproduce the targeted build on Windows, then run pnpm lint. Done means clean:dist removes a stale dist/ sentinel, the frontend build completes its TypeScript checks and production bundle, and pnpm lint completes with only existing warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript, vite
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.