TanStackT
TanStack2mo ago
2 replies
sacred-emerald

ERR_MODULE_NOT_FOUND after 1.36 --> 1.39 upgrade

Hi, When truing to build (vite build --mode production)and deploy the application I now receive this:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/jingles/Documents/workspace/my-app/dist/server/server.js' imported from /Users/jingles/Documents/workspace/my-app/node_modules/@tanstack/start-plugin-core/dist/esm/preview-server-plugin/plugin.js
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:860:10)
    at defaultResolve (node:internal/modules/esm/resolve:984:11)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at o (file:///Users/jingles/Documents/workspace/my-app/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs:1:69)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at o (file:///Users/jingles/Documents/workspace/my-app/node_modules/@tailwindcss/node/dist/esm-cache.loader.mjs:1:69)
    at nextResolve (node:internal/modules/esm/hooks:748:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
    at handleMessage (node:internal/modules/esm/worker:199:24)


Sure enough, server.js does not exist.

In my src directory I have kept the server.ts, client.ts and start.tsx. If I remove them, I still have the error. (start.tsx is required as it has my clerk middleware)

import { clerkMiddleware } from '@clerk/tanstack-react-start/server';
import { createStart } from '@tanstack/react-start';

export const startInstance = createStart(() => ({
    requestMiddleware: [clerkMiddleware()],
}));


If I run: vite dev this still works.

I checked the change log and I didn't see anything that might cause this. Maybe I missed something. Are there any known issues or changes which might cause this?

many thanks

JT
Was this page helpful?