Describe the bug
In the context of a project I'm using the commercial library called @mescius/spread-*. When bumping the project from Vite 7 to Vite 8 I started to have consistent runtime crash on production bundles (works well with dev mode).
When opening a production bundle produced via Vite 8 against this library I got the following errors in the console:
Uncaught TypeError: can't access property "DR", e.Spread.Sheets.Designer is undefined
I initially though that the issue would be fixed by following the trick explained on https://vite.dev/guide/migration#consistent-commonjs-interop that I found on the issue #21841. But it was not enough.
Reproduction
https://stackblitz.com/edit/vitejs-vite-7nfa5syp?file=package.json
Steps to reproduce
Here is the Vite 7 version: vite-7.zip.
If you want to reproduce the issue:
- Bump Vite to
^8 in the package.json
- Run
npm install
- Run a build using
npm run build
- Preview the production bundle using
npm run preview
Normally you'll not see the Excel-like display and will observe an error stack in the console.
WARNING
While I provided a stackblitz.com link, there is no possibility to run anything from @mescius/* except on localhost domain. Said differently it will not work from stackblitz.com whatever the version of Vite because the lib self-destroy itself when not running on localhost with proper API key.
System Info
System:
OS: Windows 11 10.0.26100
CPU: (12) arm64 Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) CPU
Memory: 32.13 GB / 63.49 GB
Binaries:
Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - C:\Users\Nicolas Dubien\AppData\Roaming\npm\yarn.CMD
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
pnpm: 10.16.1 - C:\Users\Nicolas Dubien\AppData\Local\pnpm\pnpm.EXE
Browsers:
Chrome: 145.0.7632.160
Edge: Chromium (141.0.3537.85)
Firefox Developer Edition: 149.0 - C:\Program Files\Firefox Developer Edition\firefox.exe
npmPackages:
@vitejs/plugin-react: ^5 => 5.2.0
vite: ^8 => 8.0.1
Used Package Manager
npm
Logs
Full build log: logs.log
Validations
Describe the bug
In the context of a project I'm using the commercial library called
@mescius/spread-*. When bumping the project from Vite 7 to Vite 8 I started to have consistent runtime crash on production bundles (works well with dev mode).When opening a production bundle produced via Vite 8 against this library I got the following errors in the console:
I initially though that the issue would be fixed by following the trick explained on https://vite.dev/guide/migration#consistent-commonjs-interop that I found on the issue #21841. But it was not enough.
Reproduction
https://stackblitz.com/edit/vitejs-vite-7nfa5syp?file=package.json
Steps to reproduce
Here is the Vite 7 version: vite-7.zip.
If you want to reproduce the issue:
^8in thepackage.jsonnpm installnpm run buildnpm run previewNormally you'll not see the Excel-like display and will observe an error stack in the console.
System Info
System: OS: Windows 11 10.0.26100 CPU: (12) arm64 Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) CPU Memory: 32.13 GB / 63.49 GB Binaries: Node: 22.14.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.22 - C:\Users\Nicolas Dubien\AppData\Roaming\npm\yarn.CMD npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD pnpm: 10.16.1 - C:\Users\Nicolas Dubien\AppData\Local\pnpm\pnpm.EXE Browsers: Chrome: 145.0.7632.160 Edge: Chromium (141.0.3537.85) Firefox Developer Edition: 149.0 - C:\Program Files\Firefox Developer Edition\firefox.exe npmPackages: @vitejs/plugin-react: ^5 => 5.2.0 vite: ^8 => 8.0.1Used Package Manager
npm
Logs
Full build log: logs.log
Validations