TanStackT
TanStackโ€ข4mo agoโ€ข
27 replies
brilliant-lime

tanstack RC broke some code

Below is the code
import {
  createStartHandler,
  defaultStreamHandler,
  defineHandlerCallback,
} from "@tanstack/react-start/server";
import { createRouter } from "./router";
import { createClerkHandler } from "@clerk/tanstack-react-start/server";


const handlerFactory = createClerkHandler(
  createStartHandler({ createRouter })
)

export default defineHandlerCallback(async (event) => {
  const startHandler = await handlerFactory(defaultStreamHandler)
  return startHandler(event)
})

below is the typescript error
[{
    "resource": "/C:/Programming Content/memorylink-alpha-convex-tanstack-clerk/src/server.ts",
    "owner": "typescript",
    "code": "2353",
    "severity": 8,
    "message": "Object literal may only specify known properties, and 'createRouter' does not exist in type 'HandlerCallback<AnyRouter>'.",
    "source": "ts",
    "startLineNumber": 11,
    "startColumn": 24,
    "endLineNumber": 11,
    "endColumn": 36,
    "modelVersionId": 71
}]

below is the error from the localhost page
An error occured while server rendering /:

    serverEntry.default.fetch is not a function
TypeError: serverEntry.default.fetch is not a function
    at file:///C:/Programming%20Content/memorylink-alpha-convex-tanstack-clerk/node_modules/.pnpm/@tanstack+start-plugin-core_6648fc0102344ffbc04844c2c161599f/node_modules/@tanstack/start-plugin-core/dist/esm/dev-server-plugin/plugin.js:64:59
Click outside, press Esc key, or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.

how can I fix this?

This used to work before pushing updates to the latest tanstack start beta

https://clerk.com/docs/quickstarts/tanstack-react-start

Below is the version of clerk/tanstack-react-start I'm using

    "@clerk/tanstack-react-start": "0.18.0",
Learn how to use Clerk to quickly and easily add secure authentication and user management to your TanStack React Start application.
TanStack React Start: TanStack React Start Quickstart (beta)
Was this page helpful?