Skip to content

Conversation

@VaibhavAcharya
Copy link
Contributor

@VaibhavAcharya VaibhavAcharya commented Oct 29, 2025

Summary

After PR #7366 (v22.1.7+), running netlify dev --cwd ./ from a monorepo package directory fails to start framework dev servers. This breaks local development workflows for monorepo users.

When --cwd ./ resolves to process.cwd(), That PR deletes the flags.cwd. This triggers logic in run-build.ts:110 that incorrectly switches to the workspace root even when running from a package subdirectory, preventing framework binaries from being found.

Add isRoot check to the workspace root logic in run-build.ts, matching the same condition used in base-command.ts:544.

Fixes #EX-552
Fixes #7392 #7528


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

📊 Benchmark results

Comparing with 0b24fc1

  • Dependency count: 1,130 (no change)
  • Package size: 321 MB (no change)
  • Number of ts-expect-error directives: 380 (no change)

@VaibhavAcharya VaibhavAcharya marked this pull request as ready for review October 29, 2025 10:46
@VaibhavAcharya VaibhavAcharya requested a review from a team as a code owner October 29, 2025 10:46
@VitaliyR
Copy link
Contributor

Looks good to me but make sure to test it good - since monorepos has a lot of possible ways being used

@serhalp
Copy link
Member

serhalp commented Oct 29, 2025

@VaibhavAcharya I think this addresses #7528 and #7392, does that sound right?

@VaibhavAcharya VaibhavAcharya force-pushed the vaibhavacharya/ex-552-netlify-cli-v2217-to-latest-fails-to-run-vite-dev-server branch from 22c39f0 to 9703141 Compare October 30, 2025 06:49
@VaibhavAcharya VaibhavAcharya requested review from a team and aitchiss October 30, 2025 06:53
Copy link

@aitchiss aitchiss left a comment

Choose a reason for hiding this comment

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

looks sensible, but +1 to Vitalii's comment about making sure we've thoroughly tested this one!

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.

Running build from the root in a monorepo does not behave like production deployment

5 participants