tRPCttRPC
Powered by
RhysR
tRPC•4y ago•
9 replies
Rhys

tRPC Cors Authentication Error

Hey, I was mainly looking to enable CORS locally for calling my tRPC endpoints in localhost:3000 (NextJS) from localhost:6006 (Storybook)

I followed this doc https://trpc.io/docs/cors and this section of the advanced usage to enable cors https://trpc.io/docs/api-handler#advanced-usage but I'm getting the following error
CORS No Allow Credentials
CORS No Allow Credentials
- Removing the
credentials: include
credentials: include
fixes this https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials however then I'm unable to use authenticated endpoints

What I'm looking to do is call my authed endpoints on localhost:3000 from localhost:6000, has anyone had experience with this?

Relevant repository code:

Next - https://github.com/AnswerOverflow/AnswerOverflow/tree/message-result-page/apps/nextjs

Storybook - https://github.com/AnswerOverflow/AnswerOverflow/tree/message-result-page/packages/ui
image.png
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

tRPC CORS error
Answer OverflowAAnswer Overflow / ❓-help
15mo ago
trpc cors
oscaramaッOoscaramaッ / ❓-help
3y ago
Getting CORS error with tRPC express adapter, locally
rhh4x0RRrhh4x0R / ❓-help
16mo ago
nextjs middleware trpc authentication
chicoCchico / ❓-help
16mo ago