Skip to content

8.0.0-beta.13 build error #595

@xxxx-p

Description

@xxxx-p

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

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions