-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Turbopack is Next.js's new Rust-based bundler that promises significantly faster builds. However, enabling Turbopack for production builds currently fails due to an incompatibility with @farcaster/hub-web.
Error Details
When running npx next build --turbopack, the build fails with:
./node_modules/@farcaster/hub-web/dist/index.mjs
Module not found: The high bits of the position 4586771 are not all 0s or 1s. modules_header_width=9, module=215
./node_modules/@farcaster/hub-web/dist/index.mjs
Module not found: The high bits of the position 4586771 are not all 0s or 1s. modules_header_width=9, module=215
This error occurs in Turbopack's Rust internals when processing the protobuf-heavy @farcaster/hub-web package.
Context
- Next.js version: 15.5.9
- @farcaster/hub-web version: 0.9.2 (bundled with @farcaster/core)
- Current bundler: webpack (via Sentry wrapper)
- Turbopack status: Works for dev server (
next dev --turbo), fails for production builds
Why This Matters
Turbopack could significantly improve build times:
- Current webpack build: ~25-35s
- Expected Turbopack improvement: 2-5x faster for incremental builds
- Better caching and parallelization
Root Cause
The @farcaster/hub-web package uses Protocol Buffers (protobuf) for Farcaster Hub communication. Turbopack's Rust-based module resolution appears to have issues with:
- Large generated protobuf files
- Complex module structure in the package's ESM output
Potential Solutions
- Wait for Turbopack fix: This appears to be a Turbopack beta limitation that may be fixed in future releases
- Report upstream to Vercel: File issue in Next.js/Turbopack repo with reproduction
- Use alternative Farcaster package: If available, use a package without protobuf dependency
- Conditional bundling: Exclude
@farcaster/hub-webfrom Turbopack processing (if supported)
Related Links
Acceptance Criteria
- Production build succeeds with
next build --turbopack - Build times are measurably improved
- No functionality regression in Farcaster Hub communication
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request