Skip to content

fix: use this.environment in hotUpdate for Vite 7 compatibility #150

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

Merged

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Jun 12, 2025

Description

I was testing my own plugin with Vite 7 beta override (hi-ogawa/vite-plugins#944) and noticed vite-plugin-inspect's hotUpdate is causing an error, which was used in one of my test case.

Cannot read properties of undefined (reading 'hot')
    at MinimalPluginContext.hotUpdate (file:///home/hiroshi/code/personal/vite-plugins/node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_lightningcs_b960494e74fe6a7fc89f3caa40fce88e/node_modules/vite-plugin-inspect/dist/shared/vite-plugin-inspect.Bht9Q8w0.mjs:681:19)

hotUpdate({ environment }) is deprecated all along during Vite 6 and hotUpdate() { this.environment } has been a stable alternative. See vitejs/vite#19986 for the detail.

Linked Issues

Additional context

@hi-ogawa hi-ogawa marked this pull request as ready for review June 12, 2025 09:46
@antfu antfu merged commit 8f6f2f8 into antfu-collective:main Jun 15, 2025
@hi-ogawa hi-ogawa deleted the fix-hotupdate-this-envirnoment branch June 15, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants