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
When File A imports a non-existent File B like import { foo } from './file_b', and later we create file_b.js to fix it, Vite doesn't pick up this new change and reload the page.
Note:
Happens in both client and SSR.
Workaround:
Client: Refresh the page.
Server: Update File A with a fake change and Ctrl+S. (because of ssrError cache in the module graph)
Potential fix:
Keep a shell module if an import doesn't exist so we have a direct link to the non-existent file upon creation.
OR when a new file is created, update all modules that are in an error state.
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
When File A imports a non-existent File B like
import { foo } from './file_b'
, and later we createfile_b.js
to fix it, Vite doesn't pick up this new change and reload the page.Note:
Workaround:
ssrError
cache in the module graph)Potential fix:
Reproduction
https://stackblitz.com/edit/vitejs-vite-biac4m?file=_foo.js,main.js&terminal=dev
Steps to reproduce
main.js
imports_foobar
which doesn't exist._foo.js
to_foobar.js
to fix it.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: