Skip to content

Defu module error Tanstack start + oRPC + turso #1005

@statusunknown418

Description

@statusunknown418
  • for anyone having this issue
[vite] connected.
23:13:18 [vite] (client) ✨ new dependencies optimized: defu
23:13:18 [vite] (client) ✨ optimized dependencies changed. reloading
23:13:18 [vite] (client) Pre-transform error: The file does not exist at "/Users/a3tech/Developer/StackkStudios/stackk-career/apps/web/node_modules/.vite/deps/esm-De31NaMY.js" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
23:13:30 [vite] vite.config.ts changed, restarting server...
23:13:30 [vite] (client) Forced re-optimi

Fix

try adding this to the vite.config

import tailwindcss from "@tailwindcss/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
	plugins: [tailwindcss(), tanstackStart(), viteReact()],
	resolve: {
		tsconfigPaths: true,
	},
	server: {
		port: 3001,
	},
	optimizeDeps: {
		exclude: ["defu"], // <- ADD THIS
	},
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions