-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
unplugin@v2.3.0
node@v22.13.1
Reproduction
I prepared a small repo to easily repro: https://github.com/elbywan/unplugin-repro
Describe the bug
To handle virtual modules with rspack, unplugin creates a dummy file under the node_modules/.virtual folder.
But when a plugin resolves multiple virtual imports to the same path in a very short notice subsequent resolveId calls may return before the file is actually created - because they won't wait for the first resolveId to finish creating the vfs file - and it will cause the rspack resolver to complain that the file is missing.
Additional context
No response
Logs
This is the kind of error that is thrown:
ERROR in ./src/imports/7994.ts 1:0-26
× Module not found: Can't resolve '/Users/julien.elbaz/dev/experiments/unplugin-repro/node_modules/.virtual/a%3Fvirtual' in '/Users/julien.elbaz/dev/experiments/unplugin-repro/src/imports'
╭────
1 │ import a from 'a?virtual';
· ───────────
╰────Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working