T
TanStack4w ago
itchy-amethyst

"Cannot use 'in' operator to search for '.' in ./index.js"

I'm running into an issue with my monorepo setup using TanStack React Start and could really use some help. My Setup: - Monorepo with pnpm workspaces and Turbo - TanStack React Start v1.130.12 - Vite v7.0.6 - Node v22.16.0 - React 19.1.1 Relevant package.json dependencies:
{
"@tanstack/react-router": "catalog:",
"@tanstack/react-start": "catalog:",
"@tanstack/router-plugin": "catalog:",
"@vitejs/plugin-react": "^4.3.4",
"vite": "catalog:",
"vite-tsconfig-paths": "^5.1.4"
}
{
"@tanstack/react-router": "catalog:",
"@tanstack/react-start": "catalog:",
"@tanstack/router-plugin": "catalog:",
"@vitejs/plugin-react": "^4.3.4",
"vite": "catalog:",
"vite-tsconfig-paths": "^5.1.4"
}
vite.config.ts:
import tailwindcss from '@tailwindcss/vite';
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
import viteReact from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import viteTsConfigPaths from 'vite-tsconfig-paths';

const config = defineConfig({
plugins: [
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart({
customViteReactPlugin: true,
spa: {
enabled: true,
},
}),
viteReact({
babel: {
plugins: [['babel-plugin-react-compiler']],
},
}),
],
resolve: {
alias: {
tslib: 'tslib/tslib.es6.js',
},
},
ssr: {
external: ['@prisma/client', 'better-auth', 'node:async_hooks'],
noExternal: ['@my-workspace/editor', 'zod', 'tslib'],
},
});

export default config;
import tailwindcss from '@tailwindcss/vite';
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
import viteReact from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import viteTsConfigPaths from 'vite-tsconfig-paths';

const config = defineConfig({
plugins: [
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart({
customViteReactPlugin: true,
spa: {
enabled: true,
},
}),
viteReact({
babel: {
plugins: [['babel-plugin-react-compiler']],
},
}),
],
resolve: {
alias: {
tslib: 'tslib/tslib.es6.js',
},
},
ssr: {
external: ['@prisma/client', 'better-auth', 'node:async_hooks'],
noExternal: ['@my-workspace/editor', 'zod', 'tslib'],
},
});

export default config;
3 Replies
itchy-amethyst
itchy-amethystOP4w ago
❌ Full Error Stack:
error when starting dev server:
TypeError: Cannot use 'in' operator to search for '.' in ./index.js
at Object.crawlPackages
(file:///path/to/node_modules/@tanstack/react-start-plugin/dist/esm/index.js:87:36)
at Object.isFrameworkPkgByJson
(file:///path/to/node_modules/@tanstack/start-plugin-core/dist/esm/plugin.js:58:88)
at file:///path/to/node_modules/vitefu/src/index.js:166:60
at async Promise.all (index 31)
at async crawl (file:///path/to/node_modules/vitefu/src/index.js:196:5)
at async crawlFrameworkPkgs (file:///path/to/node_modules/vitefu/src/index.js:53:3)
at async BasicMinimalPluginContext.config
(file:///path/to/node_modules/@tanstack/start-plugin-core/dist/esm/plugin.js:48:24)
error when starting dev server:
TypeError: Cannot use 'in' operator to search for '.' in ./index.js
at Object.crawlPackages
(file:///path/to/node_modules/@tanstack/react-start-plugin/dist/esm/index.js:87:36)
at Object.isFrameworkPkgByJson
(file:///path/to/node_modules/@tanstack/start-plugin-core/dist/esm/plugin.js:58:88)
at file:///path/to/node_modules/vitefu/src/index.js:166:60
at async Promise.all (index 31)
at async crawl (file:///path/to/node_modules/vitefu/src/index.js:196:5)
at async crawlFrameworkPkgs (file:///path/to/node_modules/vitefu/src/index.js:53:3)
at async BasicMinimalPluginContext.config
(file:///path/to/node_modules/@tanstack/start-plugin-core/dist/esm/plugin.js:48:24)
What I've tried: - Cleared node_modules and reinstalled dependencies - Verified all catalog versions are consistent across workspace - Using customViteReactPlugin: true as recommended We temporarily removed the TanStack Start plugin from vite.config.ts and the dev server started working perfectly. This confirms the issue is 100% with the TanStack React Start plugin's vitefu package crawling functionality in monorepo setups. However, removing TanStack Start means the application doesn't load at all since the entire app was built using TanStack Start architecture.
eastern-cyan
eastern-cyan4w ago
GitHub
Release v1.130.14 · TanStack/router
Version 1.130.14 - 8/2/25, 5:03 AM Changes Fix account for exports being a string (#4859) (6e191fd) by Manuel Schiller Docs start: fix cloudflare-workers deployment using wrangler.toml (#4779) (...
itchy-amethyst
itchy-amethystOP4w ago
Thanks. The problem is solved

Did you find this page helpful?