You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tiny plugin always succeeds in rollup (and vite build) and always fails in vite dev:
{
name: 'example",
load(id){if(!this.getModuleInfo(id)){thrownewError(`load should always see module info`);}},}
Rollup promises to construct moduleInfo synchronously when any load is first started, and even shows an example of calling this.load({ id })and not awaiting the promise as a way to force this.getModuleInfo(id).meta to exist.
I think this disconnect is at the root of issues like #6766.
From some commentary on a related PR it sounds like it's a goal for Vite's module graph to not contain modules that haven't finished loading yet, but if that is true getModuleInfo needs to be driven at least partly from a different source of truth that does have entries for not-yet-loaded modules.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
This tiny plugin always succeeds in rollup (and
vite build
) and always fails invite dev
:Rollup promises to construct moduleInfo synchronously when any
load
is first started, and even shows an example of callingthis.load({ id })
and not awaiting the promise as a way to forcethis.getModuleInfo(id).meta
to exist.I think this disconnect is at the root of issues like #6766.
From some commentary on a related PR it sounds like it's a goal for Vite's module graph to not contain modules that haven't finished loading yet, but if that is true
getModuleInfo
needs to be driven at least partly from a different source of truth that does have entries for not-yet-loaded modules.Reproduction
https://stackblitz.com/edit/vitejs-vite-vwpnu8sf?file=vite.config.js
Steps to reproduce
See reproduction URL and description above.
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: