You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the latest version of Vite (npm create vite@latest --template react-ts), router throws reference error as if there was circular dependency or something similar.
If I downgrade the Vite version / vite react plugin version to the version given in the stackblitz template (2.X, 1.X, respectively), it all works fine.
[ReferenceError: Cannot access](client.ts:113 ReferenceError: Cannot access 'homeLayout' before initialization)
After messing with this a bit, I narrowed down cause of the issue to be v3.X of @vitejs/plugin-react causing this issue specifically with this package. The issue does not persist with other packages, like react-router. If you downgrade @vitejs/plugin-react to 2.X or below, this issue is resolved. This will be my temporary solution for now.
Describe the bug
When using the latest version of Vite (npm create vite@latest --template react-ts), router throws reference error as if there was circular dependency or something similar.
If I downgrade the Vite version / vite react plugin version to the version given in the stackblitz template (2.X, 1.X, respectively), it all works fine.
[ReferenceError: Cannot access](client.ts:113 ReferenceError: Cannot access 'homeLayout' before initialization)
Your Example Website or App
https://stackblitz.com/edit/github-4pq3ja?file=package.json
Steps to Reproduce the Bug or Issue
Expected behavior
No error occurs.
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: