@openuiai/next
v16.3.0
Published
OpenNext.js - A development-focused fork of Next.js with Bun support
Maintainers
Readme
This is a modified fork of Next.js optimized for runtime flexibility and self-hosted deployments.
Why This Fork?
Run Next.js anywhere, your way. This fork removes vendor lock-in and gives you the freedom to choose your runtime and bundler:
- Bun Runtime — Run your entire Next.js app on Bun for blazing-fast startup, native TypeScript, and up to 4x faster installs
- Rspack Bundler — Drop-in Webpack alternative with significantly faster build times
- Self-Hosted First — Optimized for your own infrastructure, not only Vercel
- Production Ready — All build processes passing, TypeScript fully supported
Run Next.js on Bun
Drop-in Bun compatibility. No configuration needed—use bun instead of node:
bun install # 4x faster than npm
bun run dev # Native TypeScript, instant startup
bun run build # Production builds
bun run start # Production server on BunWhy Bun?
| Benefit | What You Get |
|---------|--------------|
| Instant Startup | Bun's optimized runtime starts in milliseconds |
| Native TypeScript | No transpilation step—run .ts files directly |
| 4x Faster Installs | bun install leaves npm/yarn/pnpm in the dust |
| Lower Memory | JavaScriptCore engine uses less memory than V8 |
| Faster Processes | Bun.spawn() outperforms Node.js child_process |
Full Compatibility
This fork includes a comprehensive adapter layer that makes Next.js work seamlessly on Bun:
- Automatic Runtime Detection — Detects Bun/Node.js and optimizes accordingly
- Process Adapter — Uses
Bun.spawn()for all child processes - AsyncLocalStorage — Full support with Bun-specific optimizations
- Module Loading — Leverages Bun's native TypeScript support
Bun Limitations
Transparency matters. Here's what to know:
| Feature | Status | Notes |
|---------|--------|-------|
| Core Next.js | ✅ Full | Pages, App Router, API routes all work |
| AsyncLocalStorage | ✅ Full | Server Actions, rendering context preserved |
| Child Processes | ✅ Full | Uses faster Bun.spawn() under the hood |
| Source Maps | ⚠️ Graceful fallback | Stack traces work; programmatic resolution limited |
| node:crypto | ⚠️ Partial | Some methods unavailable; Web Crypto works |
| node:vm | ⚠️ Limited | Edge cases may differ from Node.js |
| Complex IPC | ⚠️ Partial | For heavy IPC, consider Node.js |
Use Rspack Instead of Webpack
Get faster builds with Rspack—a Rust-based Webpack-compatible bundler:
# Just set the environment variable
NEXT_RSPACK=1 bun run dev
NEXT_RSPACK=1 bun run buildRspack provides significantly faster build times while maintaining Webpack compatibility. Experimental but functional.
Current Status
| Component | Status | |-----------|--------| | Build System | ✅ All processes passing | | Bun Runtime | ✅ Full Bun 1.x support | | Rspack Bundler | ✅ Experimental, functional | | TypeScript | ✅ All declaration errors resolved | | Webpack | ✅ Production-ready (default) |
Documentation
- PROJECT_STATUS.md — Complete project analysis
- TODO.md — Build testing checklist
Getting Started
Used by some of the world's largest companies, Next.js enables you to create full-stack web applications by extending the latest React features, and integrating powerful JavaScript tooling for fast builds.
- Visit our Learn Next.js course to get started with Next.js.
- Visit the Next.js Showcase to see more sites built with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Community
The OpenNext.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.
Do note that our Code of Conduct applies to all community channels. Users are highly encouraged to read and adhere to it to avoid repercussions.
Contributing
Contributions to OpenNext.js are welcome and highly appreciated. However, before you jump right into it, we would like you to review our Contribution Guidelines to make sure you have a smooth experience contributing.
Good First Issues:
We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process.
Security
If you believe you have found a security vulnerability in OpenNext.js, we encourage you to responsibly disclose this and NOT open a public issue.
Please report security issues via GitHub Security Advisories.
