Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Bug: Basic React app broken with resolve.preserveSymlinks on Windows #602

@yannbf

Description

@yannbf

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 with TypeError: Cannot read properties of null (reading 'useState').

Reproduction

https://github.com/yannbf/rolldown-windows-symlinks-issue

Steps to reproduce

  • Run the app with npm run dev
  • See the issue

System 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.0

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions