Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Build/runtime wiring is updated accordingly: Written by Cursor Bugbot for commit e7f5621. Configure here. |
Greptile SummaryThis PR fixes the PPTX worker dependency injection in the Docker image by switching from copying Key changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dockerfile as Docker Build
participant BunBuild as bun build
participant NextBuild as next build
participant Runner as Docker Runner
participant PptxVM as pptx-vm.ts
participant Worker as dist/pptx-worker.cjs
Dockerfile->>BunBuild: bun run build:pptx-worker
Note over BunBuild: Bundles pptx-worker.cjs + pptxgenjs into dist/
BunBuild-->>Dockerfile: dist/pptx-worker.cjs created
Dockerfile->>NextBuild: next build
Note over NextBuild: outputFileTracingIncludes picks up dist/pptx-worker.cjs
NextBuild-->>Dockerfile: .next/standalone output
Dockerfile->>Runner: COPY dist/pptx-worker.cjs to apps/sim/dist/
Note over Runner: No node_modules/pptxgenjs needed
Runner->>PptxVM: spawn node worker
PptxVM->>Worker: resolves via process.cwd()/apps/sim/dist/pptx-worker.cjs
Worker-->>PptxVM: IPC ready
PptxVM->>Worker: IPC generate code
Worker-->>PptxVM: IPC result base64
|
| "dev:full": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"bun run dev\" \"bun run dev:sockets\"", | ||
| "build": "next build", | ||
| "build": "bun run build:pptx-worker && next build", | ||
| "build:pptx-worker": "bun build ./lib/execution/pptx-worker.cjs --target=node --format=cjs --outfile ./dist/pptx-worker.cjs", |
There was a problem hiding this comment.
Bundling a pre-compiled
.cjs as entry point
The build:pptx-worker script takes ./lib/execution/pptx-worker.cjs as its entry point. This works, but if pptxgenjs or any of its transitive dependencies use dynamic require() with non-literal arguments (e.g. require(someVar)), bun's static bundler won't capture those modules and the worker will throw MODULE_NOT_FOUND at runtime for those paths.
pptxgenjs itself is a pure-JS library and is unlikely to have this issue, but it's worth verifying in the staging test that all PPTX generation features (including image insertion, custom fonts, etc.) work end-to-end, as those code paths in pptxgenjs may pull in optional dependencies at runtime.
Summary
Correctly inject deps for pptx worker in docker image.
Type of Change
Testing
Will test in staging env
Checklist