Skip to content

fix: resolve pnpm .modules.yaml from workspace root instead of cwd#22757

Open
btea wants to merge 2 commits into
vitejs:mainfrom
btea:fix/pnpm-modules-yaml
Open

fix: resolve pnpm .modules.yaml from workspace root instead of cwd#22757
btea wants to merge 2 commits into
vitejs:mainfrom
btea:fix/pnpm-modules-yaml

Conversation

@btea

@btea btea commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

fix #22748

@btea btea requested a review from bluwy June 23, 2026 23:50
Comment thread packages/vite/src/node/server/index.ts Outdated
const pnpmModulesYaml = path.join(cwd, 'node_modules', '.modules.yaml')
// Use workspace root (not package root) because .modules.yaml lives at the
// monorepo root's node_modules/, not in nested workspace packages.
const wsRoot = searchForWorkspaceRoot(root)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we hoist this up to before the const server variable so that it can also reuse this value, and rename this as workspaceRoot? ws feels a bit like websockets.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. 👍

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.

pnpm GVS fs.allow detection misses monorepo-root .modules.yaml for nested workspace packages

2 participants