502 FALLBACK_BODY_TOO_LARGE
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
I try to fetch a google cloud json file of 52MB but it's too large. Creating an API route or simply on the server, I think the vercel limit is always 10MB. The thing is I dont want to refetch the full file everytime then return just a part of it. What could be the workaround ?
8 Replies
Toyger
theoretically you just should put it inside app
https://vercel.com/guides/loading-static-file-nextjs-api-route and read it locally
but can you explain what are trying to do? because 52mb json doesn't look like good way to make things.
https://vercel.com/guides/loading-static-file-nextjs-api-route and read it locally
but can you explain what are trying to do? because 52mb json doesn't look like good way to make things.
@Toyger theoretically you just should put it inside app
https://vercel.com/guides/loading-static-file-nextjs-api-route and read it locally
but can you explain what are trying to do? because 52mb json doesn't look like good way to make things.
Sun bearOP
I just added it's not working only when it's on vercel. I'm doing that for a demo purpose, I know it's a bad practice but I quiet don't have the choice for now
@Sun bear I just added it's not working only when it's on vercel. I'm doing that for a demo purpose, I know it's a bad practice but I quiet don't have the choice for now
Toyger
example from vercel so it should work, maybe path is wrong or something else, what error it shows?
@Toyger example from vercel so it should work, maybe path is wrong or something else, what error it shows?
Sun bearOP
502 FALLBACK_BODY_TOO_LARGE this one
@Sun bear 502 FALLBACK_BODY_TOO_LARGE this one
Toyger
are you trying to return whole json in response to user?
@Toyger are you trying to return whole json in response to user?
Sun bearOP
I'm trying to memoize the data in a context, to be able to use it in all my components
@Sun bear I'm trying to memoize the data in a context, to be able to use it in all my components
Toyger
not sure it will work, you better use it as in vercel example, and read it locally, file is too big, even browser itself probably will not allow to do that, it also have limits on size
@Toyger not sure it will work, you better use it as in vercel example, and read it locally, file is too big, even browser itself probably will not allow to do that, it also have limits on size
Sun bearOP
yeah I commented the context and there is no error, will cut the json before memoizing 🙂 thanks for the convo !!