Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ PORT=20128
# Used by: src/app/api/v1/relay/chat/completions/route.ts
# RELAY_IP_PER_MINUTE=30

# Use Turbopack in local dev. Next 16.2.4 can fail to compile next/font/google
# through the custom dev runner without this on Windows.
OMNIROUTE_USE_TURBOPACK=1
# Bundler selection for `npm run dev`. Set to 1 to opt into Turbopack.
# Default is 0 (webpack) because Turbopack 16.2.x panics on the OmniRoute
# module graph with "internal error: entered unreachable code: there must be
# a path to a root" (turbopack-core/module_graph/mod.rs:662). Same bug class
# the production Docker build worked around in PR #4052. Webpack starts
# slower but compiles cleanly. Re-enable once upstream Turbopack ships a fix.
OMNIROUTE_USE_TURBOPACK=0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the env reference for the new webpack default

Changing the template default here to 0 leaves docs/reference/ENVIRONMENT.md:133 stale: it still documents OMNIROUTE_USE_TURBOPACK as 1 by default in .env.example and frames 0 as only a workaround. Users following the reference can re-enable the Turbopack path this change is trying to avoid, so the environment reference (and any generated mirrors, if maintained manually) should be updated with the new default and rationale.

Useful? React with 👍 / 👎.


# Skip the SQLite integrity health check on startup (faster boot on large DBs).
# Used by: src/lib/db/core.ts, src/lib/db/healthCheck.ts. Set to 1 to skip.
Expand Down
12 changes: 12 additions & 0 deletions scripts/dev/run-next.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,24 @@ process.env.OMNIROUTE_WS_BRIDGE_SECRET ||= randomUUID();
// server (read by the authz middleware in the same process). See peer-stamp.mjs.
ensurePeerStampToken();

// Next 16 picks Turbopack by default in dev. Passing `turbopack: false` to the
// programmatic next() entry is *not* enough on its own:
// - parseBundlerArgs (node_modules/next/dist/lib/bundler.js) sees no positive
// bundler flag and falls back to `process.env.TURBOPACK = 'auto'`.
// - next-dev-server.js then reads `process.env.TURBOPACK` directly and
// starts Turbopack regardless of the option we passed.
// Force webpack by both passing `webpack: true` and clearing the env var.
// Mirrors the workaround PR #4052 applied for the production Docker build.
if (!useTurbopack) {
delete process.env.TURBOPACK;
}
const nextApp = next({
dev,
dir: process.cwd(),
hostname,
port: dashboardPort,
turbopack: useTurbopack,
webpack: !useTurbopack,
});

async function start() {
Expand Down
Loading