Open fax1ty opened 1 year ago
I got
Uncaught ReferenceError: document is not defined
on production, but everything is ok locally
vite.config.ts
import eslintPlugin from "@nabla/vite-plugin-eslint"; import react from "@vitejs/plugin-react"; import autoprefixer from "autoprefixer"; import dns from "dns"; import postcssLogical from "postcss-logical"; import { defineConfig } from "vite"; import svgr from "vite-plugin-svgr"; dns.setDefaultResultOrder("verbatim"); export default defineConfig({ assetsInclude: ["**/*.glb", "**/*.gltf", "**/*.hdr", "**/*.riv"], server: { host: "localhost", port: 3000, }, plugins: [react({ fastRefresh: false }), svgr(), eslintPlugin()], worker: { plugins: [react()] }, esbuild: { jsx: "automatic" }, css: { postcss: { plugins: [autoprefixer, postcssLogical], }, }, });
also not working with @vitejs/plugin-react-swc
@vitejs/plugin-react-swc
The problem occurs because I use the Html component After building, styles are still inserted by injecting
Html
Also, it doesn't work if something uses raf
I got
on production, but everything is ok locally
vite.config.ts
also not working with
@vitejs/plugin-react-swc