OpenCut-app / OpenCut-app/OpenCut

[BUG] Type error: A type predicate cannot reference element 'element' in a binding pattern.

Open Beginner friendly
#760 0 comments 0 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

debain

Browser

non

Current Behavior

/vol1/1000/gitcocedir/OpenCut# docker compose up -d
WARN[0000] The "FREESOUND_CLIENT_ID" variable is not set. Defaulting to a blank string.
WARN[0000] The "FREESOUND_API_KEY" variable is not set. Defaulting to a blank string.
WARN[0000] The "FREESOUND_CLIENT_ID" variable is not set. Defaulting to a blank string.
WARN[0000] The "FREESOUND_API_KEY" variable is not set. Defaulting to a blank string.
[+] Building 25.8s (17/21)
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 720B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.72kB 0.0s
=> [internal] load metadata for docker.io/oven/bun:alpine 3.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 256B 0.0s
=> [base 1/1] FROM docker.io/oven/bun:alpine@sha256:7ed9f74c326d1c260abe247ac423 0.0s
=> => resolve docker.io/oven/bun:alpine@sha256:7ed9f74c326d1c260abe247ac423ccbf5 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 152.15kB 0.0s
=> CACHED [builder 1/9] WORKDIR /app 0.0s
=> CACHED [runner 2/7] RUN addgroup --system --gid 1001 nodejs 0.0s
=> CACHED [runner 3/7] RUN adduser --system --uid 1001 nextjs 0.0s
=> CACHED [builder 2/9] COPY package.json package.json 0.0s
=> CACHED [builder 3/9] COPY bun.lock bun.lock 0.0s
=> CACHED [builder 4/9] COPY turbo.json turbo.json 0.0s
=> CACHED [builder 5/9] COPY apps/web/package.json apps/web/package.json 0.0s
=> CACHED [builder 6/9] RUN bun install 0.0s
=> CACHED [builder 7/9] COPY apps/web/ apps/web/ 0.0s
=> CACHED [builder 8/9] WORKDIR /app/apps/web 0.0s
=> ERROR [builder 9/9] RUN bun run build 22.4s

[builder 9/9] RUN bun run build:
0.222 $ next build
1.785 Starting content-collections content-collections.ts
1.880 build started ...
1.894 ... finished build of 1 collection and 3 documents in 14ms
1.916 ▲ Next.js 16.1.3 (Turbopack)
1.916
1.933 Creating an optimized production build ...
11.80 ✓ Compiled successfully in 8.8s
11.80 Running TypeScript ...
21.98 Failed to compile.
21.98
21.98 ./src/lib/timeline/audio-separation/index.ts:34:5
21.98 Type error: A type predicate cannot reference element 'element' in a binding pattern.
21.98
21.98 32 | element: TimelineElement;
21.98 33 | mediaAsset: MediaAsset | null | undefined;
21.98 > 34 | }): element is VideoElement {
21.98 | ^
21.98 35 | return (
21.98 36 | element.type === "video" &&
21.98 37 | isSourceAudioEnabled({ element }) &&
22.09 Next.js build worker exited with code: 1 and signal: null
22.17 error: script "build" exited with code 1


Dockerfile:37


35 |

36 | WORKDIR /app/apps/web

37 | >>> RUN bun run build

38 |

39 | # Production image


failed to solve: process "/bin/sh -c bun run build" did not complete successfully: exit code: 1

Expected Behavior

No response

Recurrence Probability

Always

Steps To Reproduce

According to your .md requirements, after cloning the file, directly execute the docker compose up -d

Anything else?

No response

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/src/lib/timeline/audio-separation/index.ts at the reported type predicate on line 34, then inspect the surrounding TimelineElement and VideoElement definitions. Run bun run build from apps/web, or reproduce with docker compose up -d; done means the TypeScript check completes without this error and the production build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, docker-compose, nextjs, typescript
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.