fix: detect Deno workspace root (fix #22237)#22238
Open
semimikoh wants to merge 1 commit intovitejs:mainfrom
Open
fix: detect Deno workspace root (fix #22237)#22238semimikoh wants to merge 1 commit intovitejs:mainfrom
semimikoh wants to merge 1 commit intovitejs:mainfrom
Conversation
bluwy
approved these changes
Apr 16, 2026
Member
bluwy
left a comment
There was a problem hiding this comment.
I think it might be worth looking into supporting deno.json in searchForPackageRoot too, but I think this change itself is fine to fix the issue first now.
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.
Description
Adds Deno workspace detection to
searchForWorkspaceRoot.Deno workspaces are declared with the
workspacefield indeno.json. Without recognizing this config, Vite may resolve the workspaceroot to a nested package directory instead of the repository root. This can make the default
server.fs.allowtoo narrow for Denoprojects where npm packages are installed under the repository-level
node_modules/.denodirectory.This became visible after
server.fschecks started applying to environment transport module fetches.Changes
deno.jsonanddeno.jsoncfiles with aworkspacefield insearchForWorkspaceRootNotes
deno.jsoncis detected only when its contents are also valid JSON. Full JSONC parsing would require an additional parser, which this PRavoids.
Tests
pnpm exec vitest run packages/vite/src/node/server/tests/search-root.spec.ts
Fixes #22237