-
-
Notifications
You must be signed in to change notification settings - Fork 8k
[Vite 8][Regression] Cannot bundle the library @mescius/spread-* anymore #21975
Description
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 undefinedI 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
Steps to reproduce
Here is the Vite 7 version: vite-7.zip.
If you want to reproduce the issue:
- Bump Vite to
^8in thepackage.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 onlocalhostdomain. Said differently it will not work from stackblitz.com whatever the version of Vite because the lib self-destroy itself when not running onlocalhostwith 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.1Used Package Manager
npm
Logs
Full build log: logs.log
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.