Skip to content

fix(deps): move local-functions-proxy to optionalDependencies for --omit=optional support - #8422

Open
HosnainRafi wants to merge 1 commit into
netlify:mainfrom
HosnainRafi:fix/8342-optional-functions-proxy
Open

fix(deps): move local-functions-proxy to optionalDependencies for --omit=optional support#8422
HosnainRafi wants to merge 1 commit into
netlify:mainfrom
HosnainRafi:fix/8342-optional-functions-proxy

Conversation

@HosnainRafi

Copy link
Copy Markdown

Problem

netlify-cli@26.2.0 installs the @netlify/local-functions-proxy-linux-x64@1.1.1 platform binary even when npm is invoked with --omit=optional. This happens because the dependency is in regular dependencies rather than optionalDependencies, so npm does not respect the --omit=optional flag for it.

The bundled Go binary has flagged security vulnerabilities including:

Solution

  1. Moved @netlify/local-functions-proxy from dependencies to optionalDependencies in package.json. This ensures that npm install --omit=optional will skip the platform-specific binary packages.

  2. Changed the import in src/lib/functions/local-proxy.ts from 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

  • TypeScript compiles cleanly (npm run build passes)
  • ESLint clean
  • Prettier/oxfmt formatted
  • The CLI still works without local functions proxy when the package is not installed

Fixes #8342

…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
@HosnainRafi
HosnainRafi requested a review from a team as a code owner August 16, 2026 23:59
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@HosnainRafi, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e378032-8308-4545-a83f-dcee31fb481f

📥 Commits

Reviewing files that changed from the base of the PR and between 85c0113 and 9ca15ce.

📒 Files selected for processing (2)
  • package.json
  • src/lib/functions/local-proxy.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

netlify-cli 26.2.0 installs local-functions-proxy binary with --omit=optional

1 participant