fix: set the web project's root directory instead of moving the build into it - #10
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both apps are now deployed and working — this PR makes CI reproduce what I just did by hand.
Deploy webgot past the config error from PR #9 and failed at upload instead:Cause
npm workspaces hoist dependencies to the repo root, while a build run inside
apps/webrecords traced paths relative toapps/web. So the trace pointed somewhere the files weren't.Running the build from
apps/webwas treating a symptom. The actual cause is that the web project'srootDirectorywas never set —vercel linkfrom inside a directory does not set it. That's what made a repo-root build read the API'svercel.jsonin the first place.Fix
With that set, Vercel resolves the workspace itself and every step runs from the repo root again. This reverts PR #9's
working-directorychange and restores whatdocs/vercel.mdsaid 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 --prodfrom the repo root: succeedsvercel deploy --prebuilt --prod: succeedsAnd the live result:
workflowguard-web.vercel.appworkflowguard-api.vercel.app/api/health/api/healththrough the web originThat
fuzz200 also confirms PR #6 in production: the null-byte case is stored as"vendor": "acme\\u0000corp", the visible placeholder, instead of 500ing the request.