Repository navigation
ci: assert Next.js webpack build for @cofhe/sdk/web (#467) - #471
kutluhaneth46 wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5f93159. Configure here.
| // Turbopack build hangs while trying to analyse/bundle `tfhe` just because | ||
| // `@cofhe/sdk/web` was imported — even though tfhe is only needed at | ||
| // encrypt time. See FhenixProtocol/cofhesdk#467. | ||
| const mod = await import(/* webpackIgnore: true */ 'tfhe'); |
There was a problem hiding this comment.
webpackIgnore breaks runtime module loading
High Severity
webpackIgnore leaves the lazy tfhe import and the proof-worker URL as native specifiers. In a Next.js client bundle the browser cannot resolve the bare tfhe package or find zkProve.worker.js beside the emitted chunk, so initTfhe and worker proving fail when encryption runs.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 5f93159. Configure here.
There was a problem hiding this comment.
Agreed — webpackIgnore was the wrong fix. Confirmed it leaves a bare tfhe specifier (and skips emitting the worker/wasm), so encrypt fails in the browser even though Turbopack next build finishes.
Reverted that approach in 89fc6de. The hang is the known Turbopack + wasm-bindgen-rayon cycle (vercel/next.js#100131); workable path is next build --webpack (docs in #470). This PR now only adds a CI smoke that asserts the webpack workaround stays green.
|
Addressed Bugbot: dropped |
Turbopack still hangs on tfhe's wasm-bindgen-rayon worker graph (vercel/next.js#100131). Keep the supported next build --webpack workaround covered in CI for FhenixProtocol#467.
89fc6de to
12d08b5
Compare


Summary
Bugbot (and @nftpoetrist on #467) correctly flagged that
/* webpackIgnore: true */on the lazyimport('tfhe')/ proof-worker URL unblocks Turbopack but breaks runtime: the browser gets a baretfhespecifier and no bundled.wasm/ worker asset.That approach is reverted. There is no SDK-side Turbopack fix today — the hang comes from
tfhe's wasm-bindgen-rayon worker graph (vercel/next.js#100131); upstream#100182turns the hang into a build error, not a working Turbopack build. The supported workaround remainsnext build --webpack/next dev --webpack.This PR now:
@cofhe/sdk/web, thennext build --webpack(check:next-webpack+Test (Next.js webpack)job)Refs #467. No longer claims to Fix #467 in the SDK itself.
Test plan
webpackIgnoreonweb/index.ts,zkProve.worker.ts,workerManager.tsTest (Next.js webpack)green on this PRNote
Low Risk
Adds CI and a local smoke script only; no runtime or SDK packaging changes in this diff.
Overview
Adds a CI guard for the supported Next.js 16 workaround when apps import
@cofhe/sdk/web: default Turbopack builds can hang ontfhe’s wasm worker graph (#467), so consumers rely onnext build --webpack.A new
check:next-webpackscript spins up a minimal Next 16 App Router app (client component importing@cofhe/sdk/web), runsnext build --webpackwith a 3-minute timeout, and tears down the temp project. TheTest (Next.js webpack)workflow job builds@cofhe/sdkfirst, then runs that check on every PR/push.This does not change SDK bundling behavior in the diff—it only keeps the documented workaround from regressing silently.
Reviewed by Cursor Bugbot for commit 89fc6de. Bugbot is set up for automated code reviews on this repo. Configure here.