Skip to content

Commit 2370147

Browse files
committed
progress
1 parent 5c7299b commit 2370147

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.worklogs/justin/2025-09-01-dev-server-dependency-optimization.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,14 @@ An analysis of the optimizer's output in the `.vite/deps` directory has revealed
374374

375375
This is the definitive proof of the problem. Vite is processing the application and the barrel file as two completely separate dependency graphs. It correctly identifies the need for `jsx-runtime` in the application graph, but it fails to do so for the barrel file graph. When the browser attempts to render a component from the barrel's chunk, it crashes because the necessary JSX runtime is missing from its scope.
376376

377-
The root cause appears to be a failure in Vite's dependency scanner to detect the implicit `jsx-runtime` dependency for the modules imported within our barrel file.
377+
The root cause appears to be a failure in Vite's dependency scanner to detect the implicit `jsx-runtime` dependency for the modules imported within our barrel file.
378+
379+
### 9.17. The Real Root Cause: A Re-Optimization Trigger
380+
381+
Further investigation has revealed that the "duplicate dependency" issue is not a result of a dependency graph schism, but of a secondary re-optimization pass being triggered by Vite.
382+
383+
After implementing the standalone `esbuild` scan based on the `worker` entry point, we observed the following behavior:
384+
1. The initial page load is successful.
385+
2. Shortly after, the browser re-fetches the pre-bundled dependency chunks, but with a new `?v=<hash>` query string.
386+
387+
This confirms that Vite is performing a corrective re-optimization pass after the initial server startup has completed. The trigger for this re-optimization is the subject of our current investigation.

0 commit comments

Comments
 (0)