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

updating to vite 5 breaking react-router-dom #16498

Closed
7 tasks done
violabg opened this issue Apr 22, 2024 · 4 comments
Closed
7 tasks done

updating to vite 5 breaking react-router-dom #16498

violabg opened this issue Apr 22, 2024 · 4 comments
Labels
bug: upstream Bug in a dependency of Vite p5-urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@violabg
Copy link

violabg commented Apr 22, 2024

Describe the bug

I have updated to vite v5 and after that the app router is broken on build, it still works on dev.
I have linked a codesandbox were you can reproduce it

Reproduction

https://codesandbox.io/p/devbox/test-wcdysf?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clvayoaur00073d5umbubphbv%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clvayoaur00023d5uh0huen89%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clvayoaur00043d5uavoypkg1%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clvayoaur00063d5ud4j4fgvw%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clvayoaur00023d5uh0huen89%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clvayoaur00013d5u36t03ua5%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%252C%257B%2522id%2522%253A%2522clvayq7b800023d5umhogq9py%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A15%252C%2522startColumn%2522%253A34%252C%2522endLineNumber%2522%253A15%252C%2522endColumn%2522%253A34%257D%255D%252C%2522filepath%2522%253A%2522%252Fpackage.json%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522clvayoaur00023d5uh0huen89%2522%252C%2522activeTabId%2522%253A%2522clvayq7b800023d5umhogq9py%2522%257D%252C%2522clvayoaur00063d5ud4j4fgvw%2522%253A%257B%2522id%2522%253A%2522clvayoaur00063d5ud4j4fgvw%2522%252C%2522activeTabId%2522%253A%2522clvayxg1y00oz3d5uns7j7of5%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A4173%252C%2522id%2522%253A%2522clvayxg1y00oz3d5uns7j7of5%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252Fdashboard%2522%257D%255D%257D%252C%2522clvayoaur00043d5uavoypkg1%2522%253A%257B%2522id%2522%253A%2522clvayoaur00043d5uavoypkg1%2522%252C%2522activeTabId%2522%253A%2522clvb2x0uf001q3d5uqtc2oq71%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clvayoaur00033d5ufpxf2qcs%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%252C%257B%2522id%2522%253A%2522clvb2x0uf001q3d5uqtc2oq71%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TERMINAL%2522%252C%2522shellId%2522%253A%2522clvb2x0xn00kdd9ip6qyr0n18%2522%257D%255D%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Steps to reproduce

pnpm build
pnpm preview

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 279.59 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.8.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.1.0 - /opt/homebrew/bin/npm
    pnpm: 9.0.4 - ~/Library/pnpm/pnpm
    Watchman: 2023.10.09.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 124.0.6367.60
    Safari: 17.4.1
  npmPackages:
    @vitejs/plugin-react: 4.2.1 => 4.2.1 
    vite: 5.2.0 => 5.2.0

Used Package Manager

pnpm

Logs

No response

Validations

@boldurean
Copy link

Actually something happened to it recently as lazy imports stopped working on my project as well

@huijiewei
Copy link

huijiewei commented Apr 22, 2024

If you using npm, add to package.json file:

"overrides": {
    "rollup": "4.15.0"
}

If you using pnpm, add to package.json file:

"pnpm": {
    "overrides": {
        "rollup": "4.15.0"
    }
}

@liuzhaowei55
Copy link

see remix-run/react-router#11480

@sapphi-red
Copy link
Member

This is fixed by rollup/rollup#5482, released in rollup 4.16.2.

@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) p5-urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) and removed pending triage p3-minor-bug An edge case that only affects very specific usage (priority) labels Apr 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 7, 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 p5-urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Projects
None yet
Development

No branches or pull requests

5 participants