T
TanStack•3mo ago
crude-lavender

Clerk fix for 1.132

with the new release of 1.132, has anyone worked out a hack/hotfix for clerk which can be put in place to keep going with that whilst that package is updated? Trying to get the server.ts working.
import { defaultStreamHandler } from '@tanstack/react-start/server'
import { createClerkHandler } from '@clerk/tanstack-react-start/server'

// TODO fixme
const clerkHandler = createClerkHandler({} as any)

export default {
fetch(request: Request) {
return clerkHandler(defaultStreamHandler)
},
}
import { defaultStreamHandler } from '@tanstack/react-start/server'
import { createClerkHandler } from '@clerk/tanstack-react-start/server'

// TODO fixme
const clerkHandler = createClerkHandler({} as any)

export default {
fetch(request: Request) {
return clerkHandler(defaultStreamHandler)
},
}
85 Replies
passive-yellow
passive-yellow•3mo ago
No luck for me yet. I saw somewhere Clerk is aware of the issue and working on a fix. I'm patiently waiting for said fix
wise-white
wise-white•3mo ago
Same here, waiting for this issue to be fixed.I think this is the related thread on Clerk's Discord https://discord.com/channels/856971667393609759/1420142965095141477
unwilling-turquoise
unwilling-turquoise•3mo ago
There is a snapshot that you can test out now https://github.com/clerk/javascript/pull/6859
passive-yellow
passive-yellow•3mo ago
This works perfectly for me btw @mackattack3k
unwilling-turquoise
unwilling-turquoise•3mo ago
Cool it worked for me too! Now I just have 3 other bugs to sort out
fair-rose
fair-rose•2mo ago
Thanks @mackattack3k Merged 18 hours ago! https://github.com/clerk/javascript/pull/6859
GitHub
feat(tanstack-react-start): Introduce middleware and support for Ta...
Description This PR introduces a new clerkMiddleware() replacing the custom server handler. DX Guide For beta testers: Installation To test this, use the snapshot version of Clerk's TanStac...
exotic-emerald
exotic-emerald•2mo ago
Available next week! Be sure to read the changelog 😀 Use the canary version in the meantime 0.26.0-canary.v20251010143932
exotic-emerald
exotic-emerald•2mo ago
Updated docs PR. You can check the preview links https://github.com/clerk/clerk-docs/pull/2690
GitHub
Use new TanStack RC setup by wobsoriano · Pull Request #2690 · cl...
🔎 Previews: Quickstart Read session and user data auth() clerkMiddleware() What does this solve? What changed? Checklist …
unwilling-turquoise
unwilling-turquoise•2mo ago
I upgraded all my packages today (this canary being one of them) and I'm getting this error
TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:388:38)
... 8 lines matching cause stack trace ...
at next (/Users/m/dev/mankind/mvp3/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/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:388:38)
at AuthenticateContext.getSuffixedCookie (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:391:17)
at AuthenticateContext.usesSuffixedCookies (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:252:36)
at AuthenticateContext.getSuffixedOrUnSuffixedCookie (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:394:14)
at AuthenticateContext.initCookieValues (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:371:38)
at new AuthenticateContext (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:237:12)
at createAuthenticateContext (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:436:10)
at authenticateRequest (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:4994:31)
at /Users/m/dev/mankind/mvp3/node_modules/@clerk/tanstack-react-start/dist/server/clerkMiddleware.js:16:26
at next (/Users/m/dev/mankind/mvp3/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:480:16),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:388:38)
... 8 lines matching cause stack trace ...
at next (/Users/m/dev/mankind/mvp3/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/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:388:38)
at AuthenticateContext.getSuffixedCookie (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:391:17)
at AuthenticateContext.usesSuffixedCookies (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:252:36)
at AuthenticateContext.getSuffixedOrUnSuffixedCookie (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:394:14)
at AuthenticateContext.initCookieValues (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:371:38)
at new AuthenticateContext (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:237:12)
at createAuthenticateContext (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:436:10)
at authenticateRequest (file:///Users/m/dev/mankind/mvp3/node_modules/@clerk/backend/dist/chunk-5LZIGJU3.mjs:4994:31)
at /Users/m/dev/mankind/mvp3/node_modules/@clerk/tanstack-react-start/dist/server/clerkMiddleware.js:16:26
at next (/Users/m/dev/mankind/mvp3/node_modules/@tanstack/start-server-core/dist/esm/createStartHandler.js:480:16),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
Anyone else? Sorry, this was actually not related to tanstack per se. I narrowed it down to the srvx package which I upgraded from 0.8.15 -> 0.8.16 which broke this.
conscious-sapphire
conscious-sapphire•2mo ago
i have the same issue, but downgrading srvx does not have any impact 🤔
unwilling-turquoise
unwilling-turquoise•2mo ago
Can I see your package json so I can compare it to mine?
crude-lavender
crude-lavenderOP•2mo ago
yes, also getting this error...
exotic-emerald
exotic-emerald•2mo ago
unwilling-turquoise
unwilling-turquoise•2mo ago
I am running 0.26.0-canary.v20251010143932 without issues and srvx: 0.8.15. As soon as I upgrade srvx this error happens. I noticed that srvx did change the cookie handling in 0.8.16 for what its worth: https://github.com/h3js/srvx/releases/tag/v0.8.16
exotic-emerald
exotic-emerald•2mo ago
ohhh thank you so much it indeed is fixed in pre 0.8.16 of srvx worth checking @Manuel Schiller good catch @mackattack3k ! are you using srvx?
unwilling-turquoise
unwilling-turquoise•2mo ago
Nope, I'm using a custom Bun server right now (almost like the hosting docs). So its just a dependency right now.
exotic-emerald
exotic-emerald•2mo ago
GitHub
fix: do not pass signal into server function by schiller-manuel · ...
this depends on h3js/srvx#122 after this is merged and released, srvx must be bumped here Summary by CodeRabbit New Features Added a Cloudflare Workers configuration scaffold to the React start-...
exotic-emerald
exotic-emerald•2mo ago
probably not related, but yeah
equal-aqua
equal-aqua•2mo ago
i dont see the relationship between that h3 change and this yet
exotic-emerald
exotic-emerald•2mo ago
FYI, you can install the latest version now which includes tanstack start RC support https://github.com/clerk/javascript/releases/tag/%40clerk%2Ftanstack-react-start%400.26.0
GitHub
Release @clerk/tanstack-react-start@0.26.0 · clerk/javascript
Minor Changes Added support for TanStack Start v1 RC! Includes a new clerkMiddleware() global middleware replacing the custom server handler. (#6859) by @wobsoriano Usage: Create a src/start.ts ...
unwilling-turquoise
unwilling-turquoise•2mo ago
Just tried it and it works great. I upgraded srvx now too and that seems to work too. Is that expected now? No hang on, it seems to be broken if I upgrade to srvx 0.8.16 as expected still!
noble-gold
noble-gold•2mo ago
In my case I'm receiving the following error, I tried again with a fresh tanstack start app and the same error is raising
No description
exotic-emerald
exotic-emerald•2mo ago
Yeah need to pin srvx 0.8.15. Havent had the time to check whats wrong with cookie stuff in srvx side
rival-black
rival-black•2mo ago
I have srvx pinned to 0.8.15 but I'am still facing the same error:
[0] 383 | }
[0] 384 | getHeader(name) {
[0] 385 | return this.clerkRequest.headers.get(name) || void 0;
[0] 386 | }
[0] 387 | getCookie(name) {
[0] 388 | return this.clerkRequest.cookies.get(name) || void 0;
[0] ^
[0] error: undefined is not an object (evaluating 'this.clerkRequest.cookies.get')
[0] status: 500,
[0] statusText: undefined,
[0] headers: undefined,
[0] data: undefined,
[0] body: undefined,
[0] unhandled: true,
[0]
[0] at getCookie (/home/amb/workspace/instao/node_modules/@clerk/tanstack-react-start/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:388:30)
[0] at getSuffixedCookie (/home/amb/workspace/instao/node_modules/@clerk/tanstack-react-start/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:496:13)
[0] at usesSuffixedCookies (/home/amb/workspace/instao/node_modules/@clerk/tanstack-react-start/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:338:14)
[0] 383 | }
[0] 384 | getHeader(name) {
[0] 385 | return this.clerkRequest.headers.get(name) || void 0;
[0] 386 | }
[0] 387 | getCookie(name) {
[0] 388 | return this.clerkRequest.cookies.get(name) || void 0;
[0] ^
[0] error: undefined is not an object (evaluating 'this.clerkRequest.cookies.get')
[0] status: 500,
[0] statusText: undefined,
[0] headers: undefined,
[0] data: undefined,
[0] body: undefined,
[0] unhandled: true,
[0]
[0] at getCookie (/home/amb/workspace/instao/node_modules/@clerk/tanstack-react-start/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:388:30)
[0] at getSuffixedCookie (/home/amb/workspace/instao/node_modules/@clerk/tanstack-react-start/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:496:13)
[0] at usesSuffixedCookies (/home/amb/workspace/instao/node_modules/@clerk/tanstack-react-start/node_modules/@clerk/backend/dist/chunk-BY3VEEDM.mjs:338:14)
exotic-emerald
exotic-emerald•2mo ago
Try deleting node_modules
exotic-emerald
exotic-emerald•2mo ago
GitHub
GitHub - clerk/clerk-tanstack-react-start-quickstart: Learn how to ...
Learn how to use Clerk to quickly add secure authentication and user management to your TanStack Start application. - clerk/clerk-tanstack-react-start-quickstart
exotic-emerald
exotic-emerald•2mo ago
trying to figure out where exactly in srvx is causing the issue. something relating to cookie parsing
fascinating-indigo
fascinating-indigo•2mo ago
facing this error, even after all the recommended changes this is my package
{
"name": "platform",
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev --port 3000",
"start": "node .output/server/index.mjs",
"build": "vite build",
"serve": "vite preview",
"test": "vitest run",
"lint": "eslint",
"format": "prettier",
"check": "prettier --write . && eslint --fix"
},
"dependencies": {
"@clerk/clerk-react": "^5.22.13",
"@clerk/tanstack-react-start": "^0.26.0",
"@faker-js/faker": "^9.6.0",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-progress": "^1.1.7",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slider": "^1.3.6",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tooltip": "^1.2.8",
"@t3-oss/env-core": "^0.12.0",
"@tailwindcss/vite": "^4.0.6",
"@tanstack/match-sorter-utils": "^8.19.4",
"@tanstack/react-devtools": "^0.2.2",
"@tanstack/react-form": "^1.0.0",
"@tanstack/react-query": "^5.66.5",
"@tanstack/react-query-devtools": "^5.84.2",
"@tanstack/react-router": "^1.132.47",
"@tanstack/react-router-devtools": "^1.131.5",
"@tanstack/react-router-ssr-query": "^1.131.7",
"@tanstack/react-start": "^1.132.56",
"@tanstack/react-table": "^8.21.2",
"@tanstack/router-plugin": "^1.121.2",
"srvx": "0.8.15"
},
}
{
"name": "platform",
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev --port 3000",
"start": "node .output/server/index.mjs",
"build": "vite build",
"serve": "vite preview",
"test": "vitest run",
"lint": "eslint",
"format": "prettier",
"check": "prettier --write . && eslint --fix"
},
"dependencies": {
"@clerk/clerk-react": "^5.22.13",
"@clerk/tanstack-react-start": "^0.26.0",
"@faker-js/faker": "^9.6.0",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-label": "^2.1.7",
"@radix-ui/react-progress": "^1.1.7",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slider": "^1.3.6",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tooltip": "^1.2.8",
"@t3-oss/env-core": "^0.12.0",
"@tailwindcss/vite": "^4.0.6",
"@tanstack/match-sorter-utils": "^8.19.4",
"@tanstack/react-devtools": "^0.2.2",
"@tanstack/react-form": "^1.0.0",
"@tanstack/react-query": "^5.66.5",
"@tanstack/react-query-devtools": "^5.84.2",
"@tanstack/react-router": "^1.132.47",
"@tanstack/react-router-devtools": "^1.131.5",
"@tanstack/react-router-ssr-query": "^1.131.7",
"@tanstack/react-start": "^1.132.56",
"@tanstack/react-table": "^8.21.2",
"@tanstack/router-plugin": "^1.121.2",
"srvx": "0.8.15"
},
}
exotic-emerald
exotic-emerald•2mo ago
I tried your tanstack versions and they work on my end. Hmm try deleting node_modules and lockfile and reinstalling?
fascinating-indigo
fascinating-indigo•2mo ago
already tried
exotic-emerald
exotic-emerald•2mo ago
running perfectly here. These are my dependencies. Using pnpm here I had to delete node_modules and pnpm-lock and reinstall srvx@0.8.15
No description
No description
fascinating-indigo
fascinating-indigo•2mo ago
Let me try doing that again
TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32) {
cause: TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32) {
cause: TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
getting this, I don't have a server.ts replaced it with start.ts
exotic-emerald
exotic-emerald•2mo ago
xenophobic-harlequin
xenophobic-harlequin•2mo ago
Pinning srvx worked for me, thanks.
fascinating-indigo
fascinating-indigo•2mo ago
nope, followed all the steps,
TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32) {
cause: TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32) {
cause: TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:123:55)
at async handleServerRoutes (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:355:18)
at async eval (/Users/aman/Desktop/intersect/apps/web/platform/node_modules/.pnpm/@tanstack+start-server-core@1.133.3/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:243:32),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}
solved there were some issues with my router thanks for the support @wobsoriano
fair-rose
fair-rose•2mo ago
I got it to work, but wasn’t able to migrate my repo directly. I started with the updated tanstack start template then migrated everything over to that but as of right now it seems that I got it working.
rival-black
rival-black•2mo ago
Solved, also a problem in my router. Thanks for helping !
unwilling-turquoise
unwilling-turquoise•2mo ago
Holler if you need any help from my end here! I can probably set up the source and check that out too.
xenial-black
xenial-black•2mo ago
following up on this thread - is there a latest recommendation for adding clerk + start? Added the clerk middleware start.ts file, and using a lower version of srvx, but wondering if theres been movement on the clerk side that addresses the issue note: using "@tanstack/react-start": "^1.133.3"
exotic-emerald
exotic-emerald•2mo ago
I believe you got it all set up correctly. What exact issue are you experiencing?
xenial-black
xenial-black•2mo ago
thanks. Runtime error when I go to localhost:3000
TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (/Users/gabrielwilk/Amarillo/amarillo-core/node_modules/@clerk/backend/src/tokens/authenticateContext.ts:311:38)
TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (/Users/gabrielwilk/Amarillo/amarillo-core/node_modules/@clerk/backend/src/tokens/authenticateContext.ts:311:38)
{
"status": 500,
"unhandled": true,
"message": "HTTPError"
}
{
"status": 500,
"unhandled": true,
"message": "HTTPError"
}
wise-white
wise-white•2mo ago
I am getting a similar error when attempting to authenticate my convex functions with clerk. But clerk I can have up and running fine until I start trying to use it along side convex
xenial-black
xenial-black•2mo ago
yeah, i'm wrapping the
<ConvexProviderWithClerk>
<ConvexProviderWithClerk>
inside the
<ClerkProvider>
<ClerkProvider>
that might be the culprit The convex/react-clerk library might just not be ready to support the tanstack start rc
wise-white
wise-white•2mo ago
That's what I was thinking as well. Haven't seen anything in their PRs or commits that show any changes for the RC, at least none that fix this issue
exotic-emerald
exotic-emerald•2mo ago
Pinning srvx@0.8.15 fixes that error. If you still get it, try deleting node modules and your lockfile and reinstalling
xenial-black
xenial-black•2mo ago
thanks, i did try this, no luck. here is my __root.tsx file, feel like theres a lot goin on . Before upgrading to the RC was all workign smoothly: ``````
xenial-black
xenial-black•2mo ago
oh do i need to be using the nitroV2Plugin in the vite.config?
exotic-emerald
exotic-emerald•2mo ago
No need for nitro plugin. You can base your setup off of this quickstart https://github.com/clerk/clerk-tanstack-react-start-quickstart
GitHub
GitHub - clerk/clerk-tanstack-react-start-quickstart: Learn how to ...
Learn how to use Clerk to quickly add secure authentication and user management to your TanStack Start application. - clerk/clerk-tanstack-react-start-quickstart
xenial-black
xenial-black•2mo ago
thank you. yes very strange, even with using srvx version 0.8.15 Still running into this runtime issue:
{
"status": 500,
"unhandled": true,
"message": "HTTPError"
}
{
"status": 500,
"unhandled": true,
"message": "HTTPError"
}
TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (/Users/gabrielwilk/Amarillo/amarillo-core/node_modules/@clerk/backend/src/tokens/authenticateContext.ts:311:38)
... 8 lines matching cause stack trace ...
at async next (/Users/gabrielwilk/Amarillo/amarillo-core/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:480:16) {
cause: TypeError: Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')
at AuthenticateContext.getCookie (/Users/gabrielwilk/Amarillo/amarillo-core/node_modules/@clerk/backend/src/tokens/authenticateContext.ts:311:38)
... 8 lines matching cause stack trace ...
at async next (/Users/gabrielwilk/Amarillo/amarillo-core/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:480:16) {
cause: TypeError: Cannot read properties of undefined (reading 'get')
No description
xenial-black
xenial-black•2mo ago
im starting to think this is a node version issue it looks like my overrides configuration isn't forcing all transitive dependencies to use srvx@0.8.15
exotic-emerald
exotic-emerald•2mo ago
Can you share your package.json?
xenial-black
xenial-black•2mo ago
this solved it:
"resolutions": {
"srvx": "0.8.15"
},
"resolutions": {
"srvx": "0.8.15"
},
and yarn install --force think I'm running into more issues though, with convex i think not supporting node version 22, which is the new min version for tanstack start
passive-yellow
passive-yellow•2mo ago
I'm getting this same issue now, and pinning srvx to 0.8.15 is not working for me. There's something deeper here. If anyone else figures this out plz post here, I'm struggling wait nvm. got it working. I had to use 'overrides' for bun, not resolutions.
noble-gold
noble-gold•2mo ago
What worked for me is to use overrides, remove node_modules and package-lock, and point to the specific version 0.8.15 I was trying to use npm i srvx@0.8.15 and automatically was adding ^0.8.15 and installing 0.8.16, removing the caret solved it for me
exotic-emerald
exotic-emerald•2mo ago
Yeah caret will install the latest compatible version
conscious-sapphire
conscious-sapphire•2mo ago
Thanks to the above i got clerk working with the RC... except for POST server function when using bun. it seems that clerkMiddleware consume the body of the request, and thefore it mess with tanstack start internal (ERR_BODY_ALREADY_USED errors). @wobsoriano i created https://github.com/clerk/javascript/pull/7020, please lmk if that's useful / if you need any more information
exotic-emerald
exotic-emerald•2mo ago
Nice! Looks good and thanks for this
xenial-black
xenial-black•2mo ago
ok i'm making some progress here. yarn dev works, and hitting localhost works. Im able to run serverside calls to convex. Able to run serversdie authentication calls to clerk, and the conditional rendering with clerk componenets based on signed in and signed out state works. Noticing that the <SignIn> component from clerk/tanstack-react-start package has no functionality, and noticing that content wrapped inside of <motion.div> is only rendering the first paint. I'm wondering if this might be a hydration issue with start.
xenial-black
xenial-black•2mo ago
this is the error message i see in the console when the page loads:
(in promise) TypeError: import_node_async_hooks.AsyncLocalStorage is not a constructor
(in promise) TypeError: import_node_async_hooks.AsyncLocalStorage is not a constructor
no other behavior occuring on button clicks. To confirm the issue related to client-side js, i added a button with a simple onClick with a console log, and it is not working either.
No description
xenial-black
xenial-black•2mo ago
anyone else experiencing issues with client bundle? perplexity has said to: Temporarily pin TanStack Start to 1.128.3 , seems like this is not exactly right I've been using yarn
exotic-emerald
exotic-emerald•2mo ago
looks like a different issue https://github.com/TanStack/router/issues/5342 might be worth moving to a new thread
xenial-black
xenial-black•2mo ago
sweet thanks! its been a turbulent migration, i still have faith though means theres some incredible work happening on the tanstack side the issue was related to static server functions (middleware)
conscious-sapphire
conscious-sapphire•2mo ago
thanks for the merge! it was fast 🙂
exotic-emerald
exotic-emerald•2mo ago
Sorry if I wasnt able to help. Long time since I used yarn… probs v1 days
unwilling-turquoise
unwilling-turquoise•2mo ago
Checking in here again just to say that srvx released 0.9.0 which seems to change the cookies. I upgraded to latest clerk + tanstack today and then removed srvx and everything works. Thanks for the fixes! EDIT: Too fast again, I hadnt removed my node modules. It is still broken, both using srvx 0.9.1 or removing it
xenial-black
xenial-black•2mo ago
interesting. why exactly do we need to pin the version to 0.8.15? I remember seeing something about it in the clerk docs but think they removed it
exotic-emerald
exotic-emerald•2mo ago
I have so little time to check sorry. I tried to check whats happening on srvx side with no success
unwilling-turquoise
unwilling-turquoise•5w ago
Don’t stress it since we have the workaround
exotic-emerald
exotic-emerald•4w ago
I pinned my srvx version, hitting this error now: >// src/tokens/clerkRequest.ts import {parse} from "/node_modules/cookie/dist/index.js?v=c2083859"; Are these issues not being hit on the clean install starter for clerk + tanstack start? Seems odd we're just finding them tbh
fascinating-indigo
fascinating-indigo•4w ago
I can confirm they're happening on clean installs. Yesterday got the feelign of testing Start (haven't used it yet), checked out all the templates (from both Clerk and Start) and both first showed the error of get cookie and, when applied the fix (pin version of srvx), got the exact same error as you just mentioned It's a bummer but also it was clearly stated that the clerk-start sdk is in beta, so bugs are expected
Uncaught (in promise) SyntaxError: The requested module '/node_modules/cookie/dist/index.js?v=1c974169' does not provide an export named 'parse' (at clerkRequest.ts:1:10)
Uncaught (in promise) SyntaxError: The requested module '/node_modules/cookie/dist/index.js?v=1c974169' does not provide an export named 'parse' (at clerkRequest.ts:1:10)
exotic-emerald
exotic-emerald•4w ago
Oof is this a new bug. Not aware of any changes on Clerk side
exotic-emerald
exotic-emerald•4w ago
Do you still get it if you follow the tanstack versions here? https://github.com/clerk/clerk-tanstack-react-start-quickstart could be an update on tanstack side Im not aware of
GitHub
GitHub - clerk/clerk-tanstack-react-start-quickstart: Learn how to ...
Learn how to use Clerk to quickly add secure authentication and user management to your TanStack Start application. - clerk/clerk-tanstack-react-start-quickstart
fascinating-indigo
fascinating-indigo•4w ago
So far: 1. patched clerk/backend
// from
import { parse } from 'cookie'

// to

import * as cookie from "cookie"
const parse = cookie.parse
// from
import { parse } from 'cookie'

// to

import * as cookie from "cookie"
const parse = cookie.parse
This solved the issue mentioned by Peacock that I was also facing, but then I brought a new one:
Uncaught (in promise) SyntaxError: The requested module '/node_modules/use-sync-external-store/shim/index.js?v=c498fe3d' does not provide an export named 'useSyncExternalStore'
Uncaught (in promise) SyntaxError: The requested module '/node_modules/use-sync-external-store/shim/index.js?v=c498fe3d' does not provide an export named 'useSyncExternalStore'
So it didn't solve the issue, just made it appear somewhere else lol compared to their package.json, my only changes are:
@clerk/tanstack-react-start: 0.26.0 -> 0.26.5
@tanstack/react-router: 1.132.47 -> 1.134.4
@tanstack/react-start: 1.132.56 -> 1.134.7
@clerk/tanstack-react-start: 0.26.0 -> 0.26.5
@tanstack/react-router: 1.132.47 -> 1.134.4
@tanstack/react-start: 1.132.56 -> 1.134.7
exotic-emerald
exotic-emerald•4w ago
Haa what is happening Somethung changed in 1.134 maybe? Can you try 1.132 and see if the errors are gone?
fascinating-indigo
fascinating-indigo•4w ago
you 100% right, 1.132.56 has no errors lol so it happened between 1.132.56 -> 1.134.7 (latest)
exotic-emerald
exotic-emerald•4w ago
@Manuel Schiller any update in 1.133-134 that may have caused new issues above?
fascinating-indigo
fascinating-indigo•4w ago
few more tests: - removed patch for @clerk/backend - deleted both node_modules and bun.lock - up to v1.134.6 works problem definitely latest release
fascinating-indigo
fascinating-indigo•4w ago
GitHub
fix: package crawling include start-client-core by schiller-manuel ...
Summary by CodeRabbit Improvements Expanded package compatibility detection logic to recognize additional compatible packages. Optimized framework package handling to ensure excluded packages are...
fascinating-indigo
fascinating-indigo•4w ago
oh sorry there's already an issue for it: https://github.com/TanStack/router/issues/5717
GitHub
@tanstack/react-start v1.134.7 causes import error with use-sync-ex...
Which project does this relate to? Start Describe the bug When I upgrade to to v1.134.7 of @tanstack/react-start, I get a runtime error if I view a react component that imports tanstack-store. I pe...
exotic-emerald
exotic-emerald•4w ago
Oh so maybe a version before that would work? Can you try?
fascinating-indigo
fascinating-indigo•4w ago
Yup, 1.134.6 works just fine tldr (as of now): override both srvx and TS Start:
"overrides": {
"srvx": "0.8.15",
"@tanstack/react-start": "1.134.6"
},
"overrides": {
"srvx": "0.8.15",
"@tanstack/react-start": "1.134.6"
},
exotic-emerald
exotic-emerald•4w ago
Tried the latest tanstack version with fix to https://github.com/TanStack/router/issues/5717 but still getting this error
Uncaught (in promise) SyntaxError: The requested module '/node_modules/cookie/dist/index.js?v=6e55124e' does not provide an export named 'parse' (at chunk-CEKR2FXD.mjs?v=6e55124e:4283:10)
Uncaught (in promise) SyntaxError: The requested module '/node_modules/cookie/dist/index.js?v=6e55124e' does not provide an export named 'parse' (at chunk-CEKR2FXD.mjs?v=6e55124e:4283:10)
exotic-emerald
exotic-emerald•4w ago
Opened an issue for this https://github.com/TanStack/router/issues/5738 cc @Manuel Schiller
GitHub
Some server-side modules incorrectly bundled into the client? · Is...
Which project does this relate to? Start Describe the bug Starting with @tanstack/react-start@1.134.7, I think server-side modules are being incorrectly bundled into the client bundle. For example,...
exotic-emerald
exotic-emerald•4w ago
Def works in .6, something about .7 introduced this
solid-orange
solid-orange•3w ago
any solution to this? I've done:
// file: 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: [
// this is the plugin that enables path aliases
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart(),
viteReact(),
],
optimizeDeps: {
include: ['@clerk/tanstack-react-start', 'cookie'],
},
})

export default config
// file: 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: [
// this is the plugin that enables path aliases
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart(),
viteReact(),
],
optimizeDeps: {
include: ['@clerk/tanstack-react-start', 'cookie'],
},
})

export default config
updated tanstack packages:
"@tanstack/react-router": "^1.134.9",
"@tanstack/react-router-devtools": "^1.134.9",
"@tanstack/react-router-ssr-query": "^1.134.9",
"@tanstack/react-start": "^1.134.9",
"@tanstack/router-plugin": "^1.134.9",
"@tanstack/react-router": "^1.134.9",
"@tanstack/react-router-devtools": "^1.134.9",
"@tanstack/react-router-ssr-query": "^1.134.9",
"@tanstack/react-start": "^1.134.9",
"@tanstack/router-plugin": "^1.134.9",
but still getting this
"@tanstack/react-router": "^1.134.4",
"@tanstack/react-router-devtools": "^1.134.4",
"@tanstack/react-router-ssr-query": "^1.134.4",
"@tanstack/react-start": "1.134.6",
"@tanstack/router-plugin": "^1.134.4",
"@tanstack/react-router": "^1.134.4",
"@tanstack/react-router-devtools": "^1.134.4",
"@tanstack/react-router-ssr-query": "^1.134.4",
"@tanstack/react-start": "1.134.6",
"@tanstack/router-plugin": "^1.134.4",
this worked. (notice the karet ^ as well)

Did you find this page helpful?