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

4 messages · Page 1 of 1 (latest)

grave trellis
#

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"
  }

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; ```
#

❌ Full Error Stack:

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
grave trellis
#

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.

vocal tree