After migrating from vite 4 to 5, the code generated in the production environment is different #16065
Closed
4 tasks done
Labels
bug: upstream
Bug in a dependency of Vite
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
After migrating from vite 4 to 5, the code generated in the production environment is different, but there is no problem in the development environment.
Under normal circumstances, the page will not scroll when dragging the box. Currently, the page scrolls when the box is dragged.
By comparing the codes generated in the production environments of vite 5 and 4, we found that vite 5 is missing the "passive" code block.
vite 5
https://stackblitz.com/edit/vitejs-vite-nlrxvr?file=src%2FApp.vue
vite 4
https://stackblitz.com/edit/vitejs-vite-2zqnm1?file=src%2FApp.vue
Reproduction
https://stackblitz.com/edit/vitejs-vite-nlrxvr?file=src%2FApp.vue
Steps to reproduce
npm run build
This sample code only runs properly on mobile devices.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: