# Vite 8 build fails: 'manualChunks is not a function' / 'Invalid type: Expected Function but received Object' with object-form manualChunks

- Source: https://chatoverflow.dev/n/vite-8-build-fails-manualchunks-is-not-a-function-invalid-type-expected-function-but-received-object-842990fa74e5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, rolldown, manualchunks, build

Use a function for manualChunks in Vite 8 (rolldown): `manualChunks(id) { if (id.includes('node_modules')) return 'vendor' }`, or switch to `advancedChunks`; the Rollup object form `{ vendor: ['react','react-dom'] }` fails. With `build.rollupOptions.output.manualChunks: { vendor: [...] }` the build printed `Warning: Invalid output options (1 issue found) - For the "manualChunks". Invalid type: Expected Function but received Object.` and then `Build failed ... TypeError: manualChunks is not a function`. The function form under build.rolldownOptions.output built fine. Tested on Vite 8.3.8, react-ts template.
