OpenCut-app / OpenCut-app/OpenCut

[BUG]

Open
#830 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
89.8k
Forks
8.9k
PR merge metrics
No merged PRs in 30d

Description

Platform

GitHub Actions runners (ubuntu-latest, windows-latest, macos-latest); also reproduced locally on Linux with bun 1.3.11 / moon 2.3.3

Browser

N/A — this is a CI / build-tooling bug, not browser-related

Current Behavior

moon ci fails on every push and pull request to main.

The test task in apps/web runs vitest run, which reuses vite.config.ts and therefore loads the Cloudflare Vite plugin (cloudflare({ viteEnvironment: { name: 'ssr' } })). That plugin configures a Worker SSR environment that is incompatible with Vitest, so Vitest throws during config resolution, before any test is collected. Because .github/workflows/bun-ci.yml runs moon ci, the whole pipeline is red.

Error:

⎯ Startup Error ⎯
Error: The following environment options are incompatible with the Cloudflare Vite plugin:
  - "ssr" environment: `resolve.external`: [ ... node builtins ... ]
To resolve this issue, avoid setting `resolve.external` in your Cloudflare Worker environments.
    at validateWorkerEnvironmentOptions (@cloudflare/vite-plugin/dist/index.mjs)
error: script "test" exited with code 1
Expected Behavior

moon ci passes. The web test task should run under an environment compatible with the app (jsdom) and succeed — including when there are no test files yet, instead of crashing the whole pipeline.

Recurrence Probability

Always

Steps To Reproduce
  1. cd apps/web
  2. bun install
  3. bun run test # this is what moon ci runs for apps/web:test
  4. Vitest crashes at startup and exits with code 1
Anything else?

Root cause: Vitest reuses vite.config.ts, which registers the Cloudflare Vite plugin; its Worker SSR environment conflicts with Vitest's own environment setup. Separately, there are no test files yet, so even without the plugin vitest run would exit non-zero ("No test files found").

Proposed fix: give Vitest a dedicated apps/web/vitest.config.ts isolated from the Cloudflare plugin, running in jsdom with passWithNoTests: true. After that, bun run test exits 0 and moon ci is green. jsdom and @testing-library/react are already devDependencies.

Minor related fix: apps/api/moon.yml declares outputs: ['dist'] but wrangler deploy --dry-run produces no dist; adding --outdir dist makes the declared output truthful.

I already have both fixes implemented and verified locally, and can open a small focused PR once a maintainer approves, per the contribution policy.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/web/vite.config.ts and the proposed apps/web/vitest.config.ts, then run bun run test from apps/web to confirm Vitest starts with jsdom and succeeds without test files. Run moon ci to verify the workflow is green. Also inspect apps/api/moon.yml and confirm the declared dist output matches the dry-run command.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.