You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于MaterialUI的Vite应用出现createTheme_default不是函数错误

解决Uncaught TypeError: createTheme_default is not a function错误

问题详情

开发应用时遇到如下错误:

Uncaught 'TypeError: createTheme_default is not a function'

该错误在尝试使用Material UI的Mini variant Drawer后出现,即使移除该组件问题仍未消失。应用此前运行正常,无此类报错。

已尝试的无效方案

  • 已用ThemeProvider和CSSBaseline标签包裹主应用元素
  • 尝试从@mui/styles而非@mui/material导入createTheme,问题依旧

有效解决方法

执行强制重新安装npm依赖的操作即可解决:

rm -rf node_modules package-lock.json
npm install

内容的提问来源于stack exchange,提问作者Rohit Krishnan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 05:22:10