Skip to content

fix: set the web project's root directory instead of moving the build into it - #10

Merged
code-x-1010 merged 1 commit into
mainfrom
fix/web-root-directory
Sep 8, 2026
Merged

fix: set the web project's root directory instead of moving the build into it#10
code-x-1010 merged 1 commit into
mainfrom
fix/web-root-directory

Conversation

@code-x-1010

Copy link
Copy Markdown
Collaborator

Both apps are now deployed and working — this PR makes CI reproduce what I just did by hand.

Deploy web got past the config error from PR #9 and failed at upload instead:

Error: Please ensure project dependencies have been installed:
File does not exist: "node_modules/client-only/index.js"

Cause

npm workspaces hoist dependencies to the repo root, while a build run inside apps/web records traced paths relative to apps/web. So the trace pointed somewhere the files weren't.

Running the build from apps/web was treating a symptom. The actual cause is that the web project's rootDirectory was never set — vercel link from inside a directory does not set it. That's what made a repo-root build read the API's vercel.json in the first place.

Fix

vercel project update workflowguard-web --root-directory apps/web --yes

With that set, Vercel resolves the workspace itself and every step runs from the repo root again. This reverts PR #9's working-directory change and restores what docs/vercel.md said all along — the docs were right about the intent, wrong only in claiming it had been applied.

Verified before pushing

Against a clean clone with no node_modules, which is what CI has:

  • vercel build --prod from the repo root: succeeds
  • vercel deploy --prebuilt --prod: succeeds

And the live result:

Check Result
workflowguard-web.vercel.app 200
workflowguard-api.vercel.app/api/health 200
/api/health through the web origin 200 — the same-origin rewrite works
Full pipeline via the web origin upload → validate → evaluate → tests/generate → tests/run → fuzz → quality-gate, all 200

That fuzz 200 also confirms PR #6 in production: the null-byte case is stored as "vendor": "acme\\u0000corp", the visible placeholder, instead of 500ing the request.

… into it

Deploy web got past the config error from the previous fix and failed at upload:

  Error: Please ensure project dependencies have been installed:
  File does not exist: "node_modules/client-only/index.js"

npm workspaces hoist dependencies to the repo root, while a build run inside
apps/web records traced paths relative to apps/web. Running the build from that
directory was treating the symptom; the cause was that the project's
rootDirectory was never set. `vercel link` from inside a directory does not set
it, which is what left the earlier build reading the API's vercel.json.

rootDirectory is now "apps/web" on the project, so Vercel resolves the workspace
itself and every step runs from the repo root again. This reverts the
working-directory change and restores what docs/vercel.md said all along -- the
docs were right about the intent and wrong only about it having been applied.

Verified against a clean clone with no node_modules, which is what CI has: build
from the repo root succeeds and `vercel deploy --prebuilt` completes. Both
domains now serve, and /api/* through the web origin reaches the API.
@code-x-1010
code-x-1010 merged commit 90a5b60 into main Sep 8, 2026
10 checks passed
@code-x-1010
code-x-1010 deleted the fix/web-root-directory branch September 9, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant