Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Jan 31, 2025

Description

This PR fixes an issue where the handler (createStartHandler) exposed by @tanstack/start/server doesn't match the type expected by our TanStack SDK handler (createClerkHandler). Right now we're using EventHandler from vinxi/http which causes type incompatibility with TanStack's handler that returns ReturnType<typeof eventHandler> from h3.

A key difference is that eventHandler from h3 returns a function with overloaded signatures, while EventHandler from vinxi/http is a simpler type without overloads. This type mismatch creates errors for users trying to pass the handler from createStartHandler directly to createClerkHandler.

Screenshot 2025-01-31 at 10 05 44 AM

Resolves ECO-353

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel
Copy link

vercel bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 5:15pm

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: 0982e00

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/tanstack-start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

"@tanstack/start": "^1.97.25",
"esbuild-plugin-file-path-extensions": "^2.1.2"
"esbuild-plugin-file-path-extensions": "^2.1.2",
"h3": "^1.13.0"
Copy link
Member Author

@wobsoriano wobsoriano Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding to dev deps as we don't use it in runtime. Just need the return type

@wobsoriano wobsoriano merged commit 7233825 into main Jan 31, 2025
33 checks passed
@wobsoriano wobsoriano deleted the fix/tanstack-start-event-handler branch January 31, 2025 18:08
wobsoriano added a commit that referenced this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants