[PR #1030] [MERGED] fix(dev): exclude private-next-instrumentation-client from optimizeDeps #1034

Closed
opened 2026-05-06 13:11:40 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/1030
Author: @james-elicx
Created: 5/2/2026
Status: Merged
Merged: 5/2/2026
Merged by: @james-elicx

Base: mainHead: fix/instrumentation-client-optimize-deps


📝 Commits (1)

  • 745255a fix(dev): exclude private-next-instrumentation-client from optimizeDeps

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 packages/vinext/src/plugins/rsc-client-shim-excludes.ts (+4 -0)

📄 Description

Summary

  • The `private-next-instrumentation-client` bare specifier is aliased to either the user's `instrumentation-client.{ts,js}` source file or vinext's empty-module shim. Neither belongs in Vite's pre-bundled deps cache.
  • Without this exclude, Vite's dep scanner treats the unknown bare specifier as an npm dep on the first request, pre-bundles it, and triggers a full page reload (` optimized dependencies changed. reloading`).
  • Adding it to `VINEXT_OPTIMIZE_DEPS_EXCLUDE` propagates the exclude to all four environments (top-level, rsc, ssr, client) and lets the alias plugin resolve normally.

Test plan

  • Start dev server in an app that defines an `instrumentation-client.ts`; confirm no `new dependencies optimized: private-next-instrumentation-client` log on first request.
  • Edit `instrumentation-client.ts` and verify HMR still applies without a full reload.
  • Start dev server in an app without an `instrumentation-client.ts` and confirm no regression.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/1030 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 5/2/2026 **Status:** ✅ Merged **Merged:** 5/2/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/instrumentation-client-optimize-deps` --- ### 📝 Commits (1) - [`745255a`](https://github.com/cloudflare/vinext/commit/745255aa6b42b95d52742aee7b4e46256cdb6567) fix(dev): exclude private-next-instrumentation-client from optimizeDeps ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/plugins/rsc-client-shim-excludes.ts` (+4 -0) </details> ### 📄 Description ## Summary - The \`private-next-instrumentation-client\` bare specifier is aliased to either the user's \`instrumentation-client.{ts,js}\` source file or vinext's empty-module shim. Neither belongs in Vite's pre-bundled deps cache. - Without this exclude, Vite's dep scanner treats the unknown bare specifier as an npm dep on the first request, pre-bundles it, and triggers a full page reload (\`✨ optimized dependencies changed. reloading\`). - Adding it to \`VINEXT_OPTIMIZE_DEPS_EXCLUDE\` propagates the exclude to all four environments (top-level, rsc, ssr, client) and lets the alias plugin resolve normally. ## Test plan - [ ] Start dev server in an app that defines an \`instrumentation-client.ts\`; confirm no \`new dependencies optimized: private-next-instrumentation-client\` log on first request. - [ ] Edit \`instrumentation-client.ts\` and verify HMR still applies without a full reload. - [ ] Start dev server in an app *without* an \`instrumentation-client.ts\` and confirm no regression. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:40 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#1034
No description provided.