moaaz
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
Okay, Thank you for your help! ❤️
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
I was following the examples at
https://github.com/pingdotgg/uploadthing/tree/main/examples/backend-adapters
it seemed like I just use
createRouteHandler
in express server and create the button in React.
but when I didn't override the fetch in the initOpts
I received no headers/cookies so I couldn't authenticate35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
yes
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
the upload starts tho
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
That's what was tripping me
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
So I should ditch creatRouteHandler and create my own routes ?
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
better-auth if you know it
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
I am rolling my own auth
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
so how am I supposed to handle auth ?
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
since I need auth I have this custom fetch in the options
then generate the react button using
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
yup
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
since I am new to UT, from my understanding is my server creates the presigned URL and gives it back to the client which then begins directly uploading to UT.
I have no cors errors in my backend so I don't know if it's something vite related
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
you mean in my dashboard ?
35 replies
TTCTheo's Typesafe Cult
•Created by moaaz on 5/7/2025 in #questions
CORS error in react vite and express
It's client side upload.
the server is just the upload router, it looks something like this
35 replies