#Vite react app return blank page in production intermittently. How can I handle this?

1 messages · Page 1 of 1 (latest)

delicate sonnet
#

After deploying in production, sometimes the blank page appeared and turn normal after refresh. I do not know which setting causes this. Can anyone look into this setting and give me an advice please?

"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.1.2",
"@vitejs/plugin-legacy": "^6.0.2",
"@vitejs/plugin-react": "^4.3.4",
"rollup-plugin-node-polyfills": "^0.2.1",    
"rollup-plugin-visualizer": "^5.14.0",
"vite": "^6.0.3",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-svgr": "^4.3.0"
...
import { defineConfig } from 'vite';

import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    svgr({ include: '**/*.svg' }),
    nodePolyfills({
      include: ['fs', 'path', 'url'],
    }),
  ],
  define: {
    global: 'globalThis',
  },
  build: {
    outDir: 'dist',
    manifest: true,
    rollupOptions: {
      output: {
        manualChunks(id) {
          if (id.includes('node_modules/lottie-web')) {
            return 'lottie-web';
          } else if (id.includes('node_modules/react-beautiful-dnd')) {
            return 'react-beautiful-dnd';
          } 
        },
      },
      external: './src/App.tsx',
    },
  },
});
honest nexus
#

hard to tell without more insights (e.g. errors)

delicate sonnet
#

sorry but It is just as described. There is not console error, build error just return blank page.

honest nexus