Client-side JS does not work at all, h3 error in console

My app works perfectly in the developer mode. When I deploy to netlify or vercel, all of my client side JS breaks, and nothing works. There are no build errors. In the browser console, I'm getting this error: Uncaught (in promise) TypeError: Failed to resolve module specifier "h3". Relative references must start with either "/", "./", or "../".

My
app.config.ts
looks like this:

import { defineConfig } from '@tanstack/react-start/config';
import tsConfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
  vite: {
    plugins: [
      tsConfigPaths({
        projects: ['./tsconfig.json']
      })
    ],
    build: {
      rollupOptions: {
        external: [
          'node:stream',
          'node:stream/web',
          'node:async_hooks',
          'node:fs',
          'node:path'
        ]
      }
    }
  },
  server: {
    preset: 'vercel'
  }
});
Was this page helpful?