T
TanStack6mo ago
environmental-rose

Sending large amounts of data from client to server results in CORS error.

I was playing around with an xgboost package - and i tried to send a large array to a serverFn with useMutation in Start - and it errors out every time. It says CORS error but I am sure that is a red-hearing. When I reduce the size of the array it works fine. Wrapping the serverFn with userServerFn does not help either. I was originally using useQuery but had same results. Any idea what to do or try?
8 Replies
harsh-harlequin
harsh-harlequin6mo ago
how large is large? any server side logs that are helpful?
environmental-rose
environmental-roseOP6mo ago
@Manuel Schiller The array had about 3000 objects but I can try with less to see where the threshold is. No server logs - I don't think the call makes it to server at all.
harsh-harlequin
harsh-harlequin6mo ago
and how big is that in megabytes? just to get a feel
environmental-rose
environmental-roseOP6mo ago
@Manuel Schiller Full data 2.2 MB. When i slice to 100 items I get a different error ERR_CONNECTION_RESET 431 (Request Header Fields Too large)
harsh-harlequin
harsh-harlequin6mo ago
hmm can you reproduce this in a minimal complete example? then please create a github issue for that so we can track it
environmental-rose
environmental-roseOP6mo ago
Ok I 'll try @Manuel Schiller https://github.com/TanStack/router/issues/3974 Please let me know if you figure anything out - I will be doing more data sciency stuff so it would be nice to know.
harsh-harlequin
harsh-harlequin6mo ago
thanks
environmental-rose
environmental-roseOP6mo ago
by the way - i noticed some packages were a little outdated. Updated all to latest and same thing happens

Did you find this page helpful?