fix(web): parse v1 video pack runtime at compile time - #1614
Conversation
Next cannot statically parse re-exported `runtime` from the v1 pack alias, which failed v0-uvai `next build` after #1612. Declare a literal runtime and call the shared identity-pack POST handler instead. Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
There was a problem hiding this comment.
🟢 Approval recommended
The core compile fix is correct; the remaining test and documentation findings are non-blocking.
Pull request overview
Fixes Next.js static parsing for the v1 Video Pack route while preserving anonymous pack generation.
Changes:
- Declares literal Node.js runtimes for both routes.
- Extracts shared identity-pack handling.
- Adds regression coverage for route configuration.
File summaries
| File | Description |
|---|---|
src/youtube_extension/videopack/PLAN.md |
Updates implementation plan and verification evidence. |
apps/web/src/lib/video-pack.ts |
Hosts the shared POST handler. |
apps/web/src/app/api/video/pack/route.ts |
Delegates to the shared handler. |
apps/web/src/app/api/v1/video/pack/route.ts |
Replaces the invalid runtime re-export. |
apps/web/src/app/api/v1/video/pack/__tests__/route.test.ts |
Tests literal runtime configuration and pack output. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // v0-uvai `next build` after #1612 (`25b4de455`): | ||
| // "The exported configuration object in a source file needs to have a | ||
| // very specific format from which some properties can be statically parsed" | ||
| expect(V1_ROUTE_SOURCE).toMatch(/export const runtime = ['"]nodejs['"]/); |
| * **Proof Artifact:** Frontend 76 passed (7 files, including emit-video-pack fail-closed). Python 23 passed. Pack JSON locks `source_url` + `source_hash`. Missing either field throws verification failed (not a silent empty UI). Live production still 401 until this branch deploys. Golden hashes unchanged. | ||
| * `cd apps/web && npx vitest run src/app/api/v1/video/pack src/app/api/video/pack src/lib/__tests__/video-pack.test.ts src/lib/__tests__/emit-video-pack.test.ts src/lib/__tests__/auth-paths.test.ts` | ||
| * `cd apps/web && npm run build` | ||
| * **Proof Artifact:** Head `346b276f8`. Vitest 42 passed (5 files). `next build` compiled successfully and listed `ƒ /api/v1/video/pack` and `ƒ /api/video/pack`. No route-segment-config parse error. |
Closes #1613
Canonical issue
Closes #1613
GitHub issue create returned 403 from this agent (same as #1612). #1613 is the open concrete issue for anonymous pack emit.
Outcome
next buildcan statically parseapps/web/src/app/api/v1/video/pack/route.ts. AnonymousPOST /api/video/packandPOST /api/v1/video/packemit hashed Video Pack v0 withsource_url+source_hasheven without a transcript.Scope
export const runtime = 'nodejs'on the v1 pack route (noexport { POST, runtime })handleIdentityPackPostinapps/web/src/lib/video-pack.tspackage-lock.jsonrefresh (pre-existing Dockernpm cidrift; see Verification)Risk
source_url/source_hash.next build.Verification
Head:
35354080enpm run buildcompiledƒ /api/v1/video/packbuild,test,test-frontendsucceeded on this headv0-uvaiREADY: dpl_7S2b33hZkCQtRceTG2746ZGQVrQ7docker build/npm cilockfile drift (@ai-sdk/gateway@4.0.23vs^4.0.55). Same failure on main for fix: ungate anonymous Video Pack v0 emit on paste-URL #1612 (33690874574) and feat: emit hashed Video Pack v0 from paste-URL #1609 (33689441089). Not introduced by this PR. Not a required check.Anonymous POST on the READY preview (after Vercel share cookie; deployment protection is on):
Production evidence
uvai.iostill serves production deploydpl_5MgMTeTHqi5YLnVY4moMW3pbM69i(5ccbdf763/ feat: emit hashed Video Pack v0 from paste-URL #1609). AnonymousPOST https://uvai.io/api/video/packand/api/v1/video/packreturn401 {"error":"Authentication required"}.dpl_8DufAGnGcZg29oQk6ymKBk8FQKao,25b4de455) is ERROR (route-segment-config parse). uvai.io aliases (uvai.io,www.uvai.io) did not move.main(v0-uvai production auto-deploy). This agent cannot merge (GitHub 403) and cannotvercel promote(CLI has no stored credentials).Agent handoff
Closes #1613)vercel promote dpl_7S2b33hZkCQtRceTG2746ZGQVrQ7)