-
-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Describe the bug
Background:
My project is a relatively old project with many commonJs dependencies. After modifying legacy. InconsistentCjsInterop to true, the production version was built and ran normally in version 8.0.0-beta.10.
Problem: After upgrading to 8.0.0-beta.11-8.0-beta.13, building the production version reports an error:
chatSurvey-purify-CLffJMu0.js:1 Uncaught TypeError: e is not a function
The specific error file corresponds to the source code information:
import {xc as e} from "./chatSurvey-chatSurvey-Dz3uli48.js";
var t = e(( (e, t) => {
(function(n, r) {
I tried to have AI analyze and ultimately successfully built the solution provided by AI
Reasons for AI analysis: Identify the issue: After using Rolldown with Vite 8, the "purify" chunk (from vue-dompurify-html) in chatSurvey is imported from the main chunk and called as a function. In beta.11, this export may be incorrectly named or not properly exposed. Provide two solutions
Merging vue-dompurify-html and dompurify into the main chunk of chatSurvey to avoid the "e is not a function" issue caused by incorrect splitting in Rolldown beta.11.
Ai's repair plan:
rollupOptions.output.manualChunks: (id) => {
if ((id.includes('vue-dompurify-html') || id.includes('dompurify'))) {
return pageName
}
}
Reproduction
Sorry, I tried to reproduce using the minimal application, but couldn't reproduce it. It was only present in the business project I encountered at the time. One difference is that the project in my business was quite large, and JS automatically split multiple files (without setting any manual splitting code, with Vite default configuration control). Therefore, I would like to ask if you can analyze the problem based on the above description. What I can confirm is that it was caused by the import of the dependency vue domain html
Steps to reproduce
No response
System Info
vite:8.0.0-beta.13 node: 24.10.0Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs and the Rolldown-related guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- 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.