fix(deps): move local-functions-proxy to optionalDependencies for --omit=optional support - #8422
Conversation
…mit=optional support The @netlify/local-functions-proxy package (and its platform-specific sub-packages) were in regular dependencies, which meant npm installs them even with --omit=optional. This caused security scanners to flag bundled Go binary vulnerabilities (CVE-2023-24538, CVE-2023-24540, CVE-2024-24790, CVE-2025-68121). Changes: 1. Moved @netlify/local-functions-proxy from dependencies to optionalDependencies in package.json. 2. Changed the import in src/lib/functions/local-proxy.ts from a static import to a dynamic import with error handling, so that when the package is not installed (e.g., with --omit=optional), the CLI still works but local functions proxy is unavailable. Fixes netlify#8342
|
Warning Review limit reached
Next review available in: 8 minutes Limit details: You’ve used all 4 included reviews currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
netlify-cli@26.2.0installs the@netlify/local-functions-proxy-linux-x64@1.1.1platform binary even when npm is invoked with--omit=optional. This happens because the dependency is in regulardependenciesrather thanoptionalDependencies, so npm does not respect the--omit=optionalflag for it.The bundled Go binary has flagged security vulnerabilities including:
Solution
Moved
@netlify/local-functions-proxyfromdependenciestooptionalDependenciesinpackage.json. This ensures thatnpm install --omit=optionalwill skip the platform-specific binary packages.Changed the import in
src/lib/functions/local-proxy.tsfrom a static import to a dynamic import with error handling. When the package is not installed (e.g., with--omit=optional), the CLI still works but local functions proxy is unavailable — a clear error is thrown when the user tries to use local functions.Testing
npm run buildpasses)Fixes #8342