Skip to content

Vite dev server works but vite preview breaks #210

Closed
@Thiagolino8

Description

@Thiagolino8

Describe the bug

A basic vite + react + react-router app works in dev but breaks in prod
DEV:
Image

PROD:
Image

Also the build breaks if the command is run using pnpm:
Image

Aliases are also not recognized if experimental.enableNativePlugin is true

Image

Reproduction

https://codesandbox.io/p/github/Thiagolino8/repro/main

Steps to reproduce

Run npm install, npm run build and npm run preview

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-1355U
    Memory: 6.24 GB / 15.31 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 24.1.0 - /run/user/1846332781/fnm_multishells/101596_1748953649673/bin/node
    npm: 11.3.0 - /run/user/1846332781/fnm_multishells/101596_1748953649673/bin/npm
    pnpm: 10.11.0 - /run/user/1846332781/fnm_multishells/101596_1748953649673/bin/pnpm
    bun: 1.2.15 - ~/.bun/bin/bun
  npmPackages:
    @vitejs/plugin-react: ^4.5.0 => 4.5.1 
    rolldown-vite:  6.3.16

Used Package Manager

npm

Logs

npm run preview browser console Error handled by React Router default ErrorBoundary: TypeError: e is not a function

Validations

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions