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
{{ message }}
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
At Storybook we are preparing to get it ready for Vite 8. After doing some investigation why our Storybook + React + Windows were failing, I found out that it's related to a single vite config: preserveSymlinks. When rendering any React component in Storybook, it seems as if there are duplicated versions of React which normally cause problems where hooks end up not being available.
I slimmed things down to a bare minimal reproduction, essentially npm create vite + setting that one property in the vite config file. That is enough for the base app to break with TypeError: Cannot read properties of null (reading 'useState').
Describe the bug
At Storybook we are preparing to get it ready for Vite 8. After doing some investigation why our Storybook + React + Windows were failing, I found out that it's related to a single vite config:
preserveSymlinks. When rendering any React component in Storybook, it seems as if there are duplicated versions of React which normally cause problems where hooks end up not being available.I slimmed things down to a bare minimal reproduction, essentially
npm create vite+ setting that one property in the vite config file. That is enough for the base app to break withTypeError: Cannot read properties of null (reading 'useState').Reproduction
https://github.com/yannbf/rolldown-windows-symlinks-issue
Steps to reproduce
npm run devSystem Info
System: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz Memory: 4.27 GB / 15.90 GB Binaries: Node: 22.21.0 Yarn: 1.22.22 npm: 10.9.4 pnpm: 8.6.2 bun: 1.1.17 Browsers: Chrome: 145.0.7632.117 Edge: Chromium (141.0.3537.85) Internet Explorer: 11.0.19041.5794 npmPackages: @vitejs/plugin-react: ^5.0.4 => 5.1.4 rolldown-vite: 7.3.0Used Package Manager
npm
Logs
No response
Validations