Skip to content

Commit 3662ad9

Browse files
Copilothotlong
andcommitted
fix: use node-linker=hoisted in .npmrc to eliminate pnpm symlinks for Vercel deployment
Vercel runs a second pnpm install after our buildCommand completes, which re-creates pnpm symlinks before the TypeScript function bundler runs. The previous patch-symlinks.cjs approach was ineffective because it only patched during our build step, not after Vercel's own re-install. Add node-linker=hoisted to root .npmrc so pnpm uses a flat node_modules layout (no symlinks for registry packages) in both install steps. Remove the now-ineffective patch-symlinks.cjs call from build-vercel.sh. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/objectql/sessions/5c27ebc5-c40a-4756-8482-8f4c6c797208
1 parent 8da7910 commit 3662ad9

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
auto-install-peers=false
2+
node-linker=hoisted

apps/demo/scripts/build-vercel.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# 1. Build foundation packages (types → plugin-optimizations → plugins → core → platform-node)
99
# 2. Build drivers and protocols
1010
# 3. Build the project-tracker showcase example
11-
# 4. Patch pnpm symlinks so Vercel can bundle the serverless function
1211
#
1312
# Usage (called automatically by Vercel via vercel.json):
1413
# bash scripts/build-vercel.sh
@@ -48,9 +47,6 @@ pnpm --filter @objectql/protocol-graphql \
4847
echo "▸ Building project-tracker example…"
4948
pnpm --filter @objectql/example-project-tracker build
5049

51-
echo "▸ Patching pnpm symlinks for Vercel…"
52-
node scripts/patch-symlinks.cjs
53-
5450
# Ensure the output directory exists (Vercel requires it when framework=null)
5551
mkdir -p public
5652

0 commit comments

Comments
 (0)