Repository navigation
Use new TanStack RC setup - #2690
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
|
Marking this as ready for review ahead of our SDK release today. |
@wobsoriano Have added some redirects for the old links here: docs review and left a comment. The rest looks good to me, but wanna test out the new quickstart first. |
69032d9 to
f2f9111
Compare
|
@alexisintech have now given this an extensive review, but wanted to get your eyes on it for final approval. Quickstart PR associated with this is here: clerk/clerk-tanstack-react-start-quickstart#5. Think we also need a Dashboard PR to update onboarding docs, if I'm not mistaken @wobsoriano. Happy to do it if it's not in the making. |
|
I would prefer @alexisintech gives official approval, but from what I see, this LGTM. 👍 |
|
@wobsoriano Thank you very much for your hard work on this. I wasn't sure whether to create an issue or if it's a problem with documentation (my setup) but I thought I should at least tell you before you publish an announcement or something. If you want I can create an issue instead. After adding the middleware import { clerkMiddleware } from '@clerk/tanstack-react-start/server';
import { createStart } from '@tanstack/react-start';
export const startInstance = createStart(() => {
return {
requestMiddleware: [clerkMiddleware()],
};
});I get the following on every request: TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:388:38)
... 8 lines matching cause stack trace ...
at next (/Users/rich/Code/workwings/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:480:16) {
cause: TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:388:38)
at AuthenticateContext.getSuffixedCookie (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:391:17)
at AuthenticateContext.usesSuffixedCookies (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:252:36)
at AuthenticateContext.getSuffixedOrUnSuffixedCookie (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:394:14)
at AuthenticateContext.initCookieValues (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:371:38)
at new AuthenticateContext (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:237:12)
at createAuthenticateContext (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:436:10)
at authenticateRequest (file:///Users/rich/Code/workwings/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:4994:31)
at /Users/rich/Code/workwings/node_modules/@clerk/tanstack-react-start/dist/server/clerkMiddleware.js:16:26
at next (/Users/rich/Code/workwings/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:480:16),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}This is my current package versions. I've checked the PRs and made sure I have the latest clerk libraries but no success: {
"name": "[redacted]",
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev --port 3000",
"build": "vite build",
"start": "node .output/server/index.mjs",
"serve": "vite preview",
"test": "vitest run",
"format": "biome format",
"lint": "biome lint",
"check": "biome check",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"machine-translate": "inlang machine translate --project project.inlang"
},
"dependencies": {
"@auth/core": "0.37.0",
"@clerk/backend": "^2.18.0",
"@clerk/clerk-js": "^5.100.0",
"@clerk/clerk-react": "^5.52.0",
"@clerk/tanstack-react-start": "^0.26.0",
"@convex-dev/auth": "^0.0.90",
"@convex-dev/react-query": "0.0.0-alpha.11",
"@faker-js/faker": "^10.0.0",
"@orpc/client": "^1.7.5",
"@orpc/json-schema": "^1.7.5",
"@orpc/openapi": "^1.7.5",
"@orpc/server": "^1.7.5",
"@orpc/tanstack-query": "^1.7.5",
"@orpc/zod": "^1.7.5",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-slider": "^1.3.6",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.6",
"@storybook/react-vite": "^9.1.9",
"@t3-oss/env-core": "^0.13.8",
"@tailwindcss/vite": "^4.0.6",
"@tanstack/match-sorter-utils": "^8.19.4",
"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-form": "^1.0.0",
"@tanstack/react-query": "^5.66.5",
"@tanstack/react-query-devtools": "^5.84.2",
"@tanstack/react-router": "^1.132.0",
"@tanstack/react-router-devtools": "^1.132.0",
"@tanstack/react-router-ssr-query": "^1.131.7",
"@tanstack/react-router-with-query": "^1.130.17",
"@tanstack/react-start": "^1.132.0",
"@tanstack/react-store": "^0.7.0",
"@tanstack/react-table": "^8.21.2",
"@tanstack/router-plugin": "^1.132.0",
"@tanstack/store": "^0.7.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"convex": "^1.27.3",
"lucide-react": "^0.544.0",
"nitro": "npm:nitro-nightly",
"posthog-js": "^1.273.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"storybook": "^9.1.9",
"tailwind-merge": "^3.0.2",
"tailwindcss": "^4.0.6",
"tw-animate-css": "^1.3.6",
"vite-tsconfig-paths": "^5.1.4",
"zod": "^4.1.11"
},
"devDependencies": {
"@biomejs/biome": "2.2.4",
"@inlang/cli": "^3.0.0",
"@inlang/paraglide-js": "2.4.0",
"@tanstack/devtools-event-client": "^0.3.2",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.2.0",
"@types/node": "^22.10.2",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^5.0.4",
"jsdom": "^27.0.0",
"typescript": "^5.7.2",
"vite": "^7.1.7",
"vitest": "^3.0.5",
"web-vitals": "^5.1.0"
},
"trustedDependencies": [
"@clerk/shared",
"@tailwindcss/oxide",
"browser-tabs-lock",
"core-js"
]
} |
|
@richardvanbergen there's an upstream issue with a TanStack dependency and the fix is to pin |
|
@wobsoriano Sorry that didn't work I:
I still see the same error. I'm going to try and see if I can make a minimal reproduction repo. if I can't then I'll just migrate my app over to it. If I can I'll post it to clerk/backend issues. |
|
Nevermind. I couldn't reproduce in another repo. So I just started deleting stuff from my Sorry for the extra chatter and congratulations on a newly shipped feature! |
Here you go: https://github.com/clerk/dashboard/pull/7313. |
|
@SarahSoutoul @wobsoriano taking a look now |
alexisintech
left a comment
There was a problem hiding this comment.
I've posted my review - if you agree with these changes @wobsoriano I can update the quickstart repo to match these changes :)
Co-authored-by: Robert Soriano <sorianorobertc@gmail.com>
To both of you @alexisintech @wobsoriano, have updated the Dashboard PR accordingly after the recent changes if you could have another quick link: https://github.com/clerk/dashboard/pull/7313/files. Didn't include the |
I'm going to mark this as blocked until we have rob's responses! |
|
@alexisintech @SarahSoutoul tbh I think we can skip the |
|
I think we might be good to go no? @alexisintech @wobsoriano |
|
merging it! |
🔎 Previews:
auth()clerkMiddleware()What does this solve?
clerkMiddleware()in our SDK. See feat(tanstack-react-start): Introduce middleware and support for TanStack Start RC javascript#6859What changed?
createClerkHandler) is used and replaced withclerkMiddleware()usage.getAuth(request)to useauth()Checklist