Skip to content

Commit 0abcd19

Browse files
committed
fix windoes build
chore(nextjs): update configuration for fs-safe package handling in Cloudflare and Vercel examples - Added `@openclaw/fs-safe` to `serverExternalPackages` in Cloudflare example to prevent build failures with Turbopack. - Updated Vercel example to include `@openclaw/fs-safe` in the external packages list, with comments explaining its native helper loading issue. - Documented deployment examples in the registry for clarity on CI typechecking and build processes.
1 parent 7967493 commit 0abcd19

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

examples/nextjs-cloudflare/next.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ const nextConfig = {
55
// Unlike the Vercel example, we do NOT mark the @nodetool-ai/* packages as
66
// external: OpenNext bundles everything into the Worker, and `nodejs_compat`
77
// (wrangler.jsonc) supplies the Node built-ins the runtime stack lazy-loads.
8+
//
9+
// The one exception is fs-safe (a @nodetool-ai/storage dependency). It loads
10+
// its native helper with `new URL("../dist/native/", import.meta.url)` +
11+
// `require`, which Turbopack cannot resolve statically and fails the build
12+
// on. Kept external here; OpenNext copies it into the Worker bundle from the
13+
// route trace, and the missing `.node` binary there makes fs-safe fall back
14+
// to its JS path (its native mode defaults to "auto").
15+
serverExternalPackages: ["@openclaw/fs-safe"]
816
};
917

1018
// Enable Cloudflare bindings (R2, KV, secrets, etc.) during `next dev`.

examples/nextjs-vercel/next.config.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ const nextConfig = {
1010
"@nodetool-ai/node-sdk",
1111
"@nodetool-ai/nodes-utils",
1212
"@nodetool-ai/core-nodes",
13-
"@nodetool-ai/llm-nodes"
13+
"@nodetool-ai/llm-nodes",
14+
// fs-safe (a @nodetool-ai/storage dependency) loads its native helper with
15+
// `new URL("../dist/native/", import.meta.url)` + `require`, which
16+
// Turbopack cannot resolve statically. Inside the monorepo the
17+
// @nodetool-ai/* entries above are symlinked workspaces, not
18+
// node_modules, so Next bundles them anyway and reaches this import.
19+
"@openclaw/fs-safe"
1420
]
1521
};
1622

packages/cli/src/harness/registry.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,13 @@ export const SURFACES: SurfaceEntry[] = [
15151515
* one that is in neither.
15161516
*/
15171517
export const UNCLAIMED_PATHS: Record<string, string> = {
1518+
"examples/nextjs-vercel/":
1519+
"Deployment example app. CI typechecks it (`npm run typecheck:examples`); " +
1520+
"its `next build` costs minutes and belongs to deploys, not the PR gate. " +
1521+
"No harness drives it headlessly.",
1522+
"examples/nextjs-cloudflare/":
1523+
"Deployment example app, same standing as examples/nextjs-vercel/: " +
1524+
"typechecked in CI, built only on deploy, no headless harness.",
15181525
"packages/compute/":
15191526
"Provisions and reaps real RunPod/Vast.ai GPU workers; only its hermetic " +
15201527
"unit tests run headlessly today. A harness needs a recorded-fixture " +

0 commit comments

Comments
 (0)