OpenCut-app / OpenCut-app/OpenCut

Docker build fails on main: 5 TypeScript errors prevent production build

Open
#782 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Summary

Running docker compose up -d --build on the current main branch fails with TypeScript errors. The Next.js build exits on the first error, so they surface one at a time. There are 5 distinct issues across 4 files.

Environment

  • macOS (Darwin 25.3.0)
  • Docker Desktop 4.71.0
  • Docker Compose v5.1.3
  • Installed via docker compose up -d --build per the README

Errors (in order of appearance)

1. Missing export: isShortcutKeysrc/actions/keybinding.ts

src/actions/keybindings/persistence.ts imports isShortcutKey from @/actions/keybinding, but the function is never defined or exported from that module.

Type error: '"@/actions/keybinding"' has no exported member named 'isShortcutKey'. Did you mean 'ShortcutKey'?
  --> src/actions/keybindings/persistence.ts:2

Fix: Add a type guard to src/actions/keybinding.ts:

const MODIFIER_SET = new Set<string>([
  "ctrl", "alt", "shift", "ctrl+shift", "alt+shift", "ctrl+alt", "ctrl+alt+shift",
]);

export function isShortcutKey(value: string): value is ShortcutKey {
  if (isKey(value)) return true;
  const lastPlus = value.lastIndexOf("+");
  if (lastPlus === -1) return false;
  return MODIFIER_SET.has(value.slice(0, lastPlus)) && isKey(value.slice(lastPlus + 1));
}

2. Missing export: isActionWithOptionalArgssrc/actions/definitions.ts

src/actions/keybindings/persistence.ts imports isActionWithOptionalArgs from @/actions, but no such function is exported anywhere in that module tree.

Type error: '"@/actions"' has no exported member named 'isActionWithOptionalArgs'. Did you mean 'TActionWithOptionalArgs'?
  --> src/actions/keybindings/persistence.ts:4

Fix: Add a runtime guard to src/actions/definitions.ts:

const ACTION_SET = new Set<string>(Object.keys(ACTIONS));
const REQUIRED_ARGS_ACTIONS = new Set<string>(["remove-media-asset", "remove-media-assets"]);

export function isActionWithOptionalArgs(value: string): value is TActionWithOptionalArgs {
  return ACTION_SET.has(value) && !REQUIRED_ARGS_ACTIONS.has(value);
}

3. IndexedDBAdapter called with positional args (3 occurrences) — src/services/storage/migrations/

The IndexedDBAdapter constructor signature is ({ dbName, storeName, version }), but the migration files call it with three positional arguments.

Type error: Expected 1 arguments, but got 3.
  --> src/services/storage/migrations/runner.ts:43
  --> src/services/storage/migrations/v1-to-v2.ts:126
  --> src/services/storage/migrations/v1-to-v2.ts:135
  --> src/services/storage/migrations/v1-to-v2.ts:162

Additionally, projectsAdapter.set(projectId, result.project) in runner.ts:98 uses the old positional API; the current signature is set({ key, value }).

Fix: Update all call sites to use the object API:

// Before
new IndexedDBAdapter<T>("db-name", "store-name", 1)

// After
new IndexedDBAdapter<T>({ dbName: "db-name", storeName: "store-name", version: 1 })
// Before
await projectsAdapter.set(projectId, result.project)

// After
await projectsAdapter.set({ key: projectId, value: result.project })

4. stickersRegistry.register() called with positional args — src/stickers/providers/index.ts

DefinitionRegistry.register() takes { key, definition }, but src/stickers/providers/index.ts:22 passes two positional arguments.

Type error: Expected 1 arguments, but got 2.
  --> src/stickers/providers/index.ts:22

Fix:

// Before
stickersRegistry.register(provider.id, provider)

// After
stickersRegistry.register({ key: provider.id, definition: provider })

Notes

These all look like the result of an API refactor (positional args → object args) that wasn't applied consistently across all call sites. All five fixes are mechanical and do not require any logic changes.

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 by running docker compose up -d --build and use the reported errors to inspect src/actions/keybinding.ts, src/actions/definitions.ts, the files under src/services/storage/migrations/, and src/stickers/providers/index.ts. Check the related current APIs and update the listed stale call sites consistently. Done means the production TypeScript build completes without these five errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, nextjs, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.