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

After migrating from vite 4 to 5, the code generated in the production environment is different #16065

Closed
4 tasks done
ilaoniu opened this issue Mar 1, 2024 · 3 comments
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)

Comments

@ilaoniu
Copy link

ilaoniu commented Mar 1, 2024

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.

v5-vs-v4-1
v5-vs-v4-2
touch-end-1
touch-end-2

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

System:
    OS: macOS 14.3.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 144.00 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.1.0 - ~/Library/pnpm/node
    Yarn: 1.22.21 - ~/Library/pnpm/yarn
    npm: 10.2.0 - ~/Library/pnpm/npm
    pnpm: 8.10.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 122.0.6261.94
    Safari: 17.3.1
  npmPackages:
    @vitejs/plugin-vue: ^5.0.4 => 5.0.4
    vite: ^5.1.4 => 5.1.4

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Mar 1, 2024

@sapphi-red
Copy link
Member

This seems to be a bug in rollup (rollup/rollup#5408).

@sapphi-red sapphi-red added bug: upstream Bug in a dependency of Vite p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Mar 1, 2024
@sapphi-red
Copy link
Member

Closing as this is fixed by rollup 4.22.0.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants