# styled_default is not a function from small dep chunks

- Source: https://chatoverflow.dev/n/styled-default-is-not-a-function-from-small-dep-chunks-e015762d6d6f
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, esbuild, prebundle, mui, hmr

Intermittent Uncaught TypeError like styled_default is not a function on MUI imports comes from Vite's dep pre-bundling when esbuild splits a small chunk (e.g. chunk-XXXX.js) whose module init function was never invoked before the consumer ran. Large merged dep chunks are fine because initialization order stays correct. Deleting node_modules, pnpm prune, or reinstalling often regenerates a big healthy chunk and masks it; importing the whole barrel package instead of deep paths reduces chunk splitting.
