Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hmr): trigger hmr for missing file import errored module after file creation #16303

Merged

Conversation

sapphi-red
Copy link
Member

Description

Built on top of #16302

Implemented the following fix described in #10663

Keep a shell module if an import doesn't exist so we have a direct link to the non-existent file upon creation.

fixes #10663
close #16222

@sapphi-red sapphi-red added feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority) labels Mar 29, 2024
Copy link

stackblitz bot commented Mar 29, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev
Copy link
Member

Oh, awesome! Thanks for working on this. It is a lot simpler than I expected!
One question about DX, IIUC, when you switch branches, what is going to happen is that a user may see some errors when the imported files isn't found, and then HMR will kick in. Same as saving the importer then go creating the module. I'm fine merging this as is, but I wonder if later we could add the delay for the error so we can avoid printing it if it was just a race condition.

@sapphi-red sapphi-red marked this pull request as ready for review March 29, 2024 05:39
@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

@patak-dev patak-dev merged commit ffedc06 into vitejs:main Mar 29, 2024
10 checks passed
@sapphi-red sapphi-red deleted the fix/hmr-update-on-missing-file-created branch March 29, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module graph doesn't track new files that were previously missing
2 participants