Uncaught Error: Minified React error #31; visit Minified React error #31 – React for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
how to fix this, iit always giive same error
Uncaught Error: Minified React error #31; visit Minified React error #31 – React for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
how to fix this, iit always giive same error
Check the imports in the index.html file. There’s a chance that it mixed React 18 with React 19 in there. This error tends to cause various annoying errors.
yes but fix severral times still there
很好,你这个 package.json 一看就确认了几个点:
依赖里用的 React 18.3.1(不是 React 19,所以 useEffect 报 null 可能是 importmap 把 React 指到 react@19 的 esm.sh)。
已经安装了 tailwindcss、postcss、autoprefixer → 配置没问题的话,Vite 应该会产出 CSS。
为什么页面没有样式?
从你之前贴的 编译后的 HTML 来看:
这里最大的问题是:你在 dist/index.html 里写死了 importmap,覆盖了 Vite 默认注入的 script 和 css link。
正常情况下,Vite build 出来的 HTML 会有类似:
ReactDOM.createRoot(document.getElementById(“root”)!).render(
<React.StrictMode>
</React.StrictMode>
);
总结
你现在没样式是因为 importmap 让 Vite 没法注入 Tailwind 产物。
删掉 importmap,走 Vite 默认的依赖打包和 HTML 注入 → 样式就能正常加载。
同时 React 也要用 package.json 的 18.3.1,不要混 esm.sh 的 19.x,否则就会报 useEffect of null。
要不要我帮你写一个 正确的 index.html(适配 Vite + Tailwind + React 18),你直接替换掉现在那个 importmap 版本?
DarkSealer via Google AI Developers Forum <notifications@discuss.ai.google.dev> 于2025年11月4日周二 16:10写道: