forked from vitejs/vite
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed as not planned
Closed as not planned
Build errors with "DataCloneError: #<Object> could not be cloned." using
rollup-plugin-webpack-stats
#128Bug
Copy link
Labels
wontfixThis will not be worked onThis will not be worked on
Description
Describe the bug
Installing rollup-plugin-webpack-stats
will crash the build command, due to the fact that the bundleEntry stats can't be cloned via structuredClone
due to some parts (like code
) being a getter. In plain vite, code
(and others) are clonable types like strings.
// rolldown-vite
bundleEntryStats: {
type: 'chunk',
code: [Getter],
fileName: 'assets/index-BHKjzJ0u.js',
name: 'index',
modules: [Getter],
imports: [Getter],
dynamicImports: [Getter],
exports: [],
isEntry: true,
facadeModuleId: '/Users/alichter/Programming/rolldown-vite-reproductions/index.html',
isDynamicEntry: false,
moduleIds: [Getter],
map: [Getter],
sourcemapFileName: null,
preliminaryFileName: 'assets/index-!~{000}~.js'
}
}
// vite
bundleEntryStats: {
exports: [],
facadeModuleId: '/Users/alichter/Programming/rolldown-vite-reproductions/index.html',
isDynamicEntry: false,
isEntry: true,
isImplicitEntry: false,
moduleIds: [
'\x00vite/modulepreload-polyfill.js',
'/Users/alichter/Programming/rolldown-vite-reproductions/src/main.ts',
'/Users/alichter/Programming/rolldown-vite-reproductions/index.html'
],
name: 'index',
type: 'chunk',
dynamicImports: [],
fileName: 'assets/index-BYaVEE6b.js',
implicitlyLoadedBefore: [],
importedBindings: {},
imports: [],
modules: [Object: null prototype] {
'\x00vite/modulepreload-polyfill.js': [Object],
'/Users/alichter/Programming/rolldown-vite-reproductions/src/main.ts': [Object],
'/Users/alichter/Programming/rolldown-vite-reproductions/index.html': [Object]
},
referencedFiles: [],
viteMetadata: { importedAssets: Set(0) {}, importedCss: Set(0) {} },
code: '(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll(\'link[rel="modulepreload"]\'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}})();document.querySelector("#app").innerHTML=`\n' +
' <div>\n' +
' \n' +
' </div>\n' +
'`;\n',
map: null,
preliminaryFileName: 'assets/index-!~{001}~.js',
sourcemapFileName: null
}
}
Reproduction
Steps to reproduce
See README (pnpm i && pnpm build basically)
System Info
System:
OS: macOS 15.3.2
CPU: (12) arm64 Apple M2 Max
Memory: 102.83 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - /usr/local/bin/node
Yarn: 1.22.21 - /opt/homebrew/bin/yarn
npm: 10.9.2 - /usr/local/bin/npm
pnpm: 10.8.0 - ~/.npm/bin/pnpm
bun: 1.0.30 - /opt/homebrew/bin/bun
Browsers:
Chrome: 135.0.7049.96
Safari: 18.3.1
npmPackages:
rolldown-vite: 6.3.1
Used Package Manager
pnpm
Logs
Details
pnpm build
✗ Build failed in 23ms
error during build:
Build failed with 1 error:
TypeError: Cannot set property code of which has only a getter
at logPluginError (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rolldown/dist/shared/parse-ast-index-lybCSSSh.mjs:509:15)
at plugin.<computed> (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rolldown/dist/shared/src-CY9fSPIv.mjs:2128:18)
at normalizeErrors (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rolldown/dist/shared/src-CY9fSPIv.mjs:933:18)
at handleOutputErrors (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rolldown/dist/shared/src-CY9fSPIv.mjs:1779:34)
at transformToRollupOutput (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rolldown/dist/shared/src-CY9fSPIv.mjs:1773:2)
at RolldownBuild.write (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rolldown/dist/shared/src-CY9fSPIv.mjs:4121:11)
at async buildEnvironment (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/rolldown-vite/dist/node/chunks/dep-BTSkQaSA.js:44143:16)
at async Object.defaultBuildApp [as buildApp] (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/rolldown-vite/dist/node/chunks/dep-BTSkQaSA.js:44647:5)
at async CAC.<anonymous> (file:///Users/alichter/Programming/rolldown-vite-reproductions/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/rolldown-vite/dist/node/cli.js:863:7)
ELIFECYCLE Command failed with exit code 1.
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.
Metadata
Metadata
Assignees
Labels
wontfixThis will not be worked onThis will not be worked on