Today's Trends
minorInvestigatingVitev7.x

Vite 7 Dep Optimizer Skips Dynamic Imports in Unreferenced Functions

  1. Investigating(current)
  2. Trending(upcoming)
  3. Workaround available(upcoming)
  4. Resolved(upcoming)

Executive summary

The Vite 7 dep optimizer fails to scan dynamic imports inside unreferenced functions, leading to missing dependencies and potential runtime issues. This affects single-file components where event handlers or actions are used only within the template.

No verified workaround yet

None of the linked reports describe a mitigation. Follow this incident to hear when one appears.

Technical root cause

Under active investigation. No report has identified a root cause yet.

Evidence

1 report · 1 GitHubShow
  1. [1]
    GitHub First report
    Dep optimizer scan misses dynamic imports inside unreferenced functions (regression from Vite 7), e.g. Svelte/Vue handlers used only in the template(opens GitHub issue in a new tab)

    Describe the bug Since the Rolldown-based dependency scanner, a dynamic import() inside a function that the scanned module never references is not crawled. Dependencies of the imported module are not pre-bundled at startup. Vite 7's esbuild scanner did crawl them. This matters for single-file components. The scanner sees only the <script> block, so a function used only in the template (an event handler, a Svelte action or {@attach}, a Vue @click) looks unreferenced. Its lazily imported…

    by janosh 0upvotes 0comments

Timeline

  1. First report on GitHub issue

    Dep optimizer scan misses dynamic imports inside unreferenced functions (regression from Vite 7), e.g. Svelte/Vue handlers used only in the template

    Source