You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When returning a buffer in an edge function with type application/pdf, the supabase JS client does not parse the result correctly. It is parsed as a string, but not as a blob.
It is stated here, that the return parsing depends on the content-type of the result, so the application/pdf should be parsed as blob. Instead, it is parsed as a string.
When changing the type to e.g. application/octet-stream, it is correctly parsed as a blob.
So, when using the JS supabase library (await this.supabase.functions.invoke()), it parsed the result incorrectly.
Also, when using e.g. Postman and testing the same function with type application/pdf, the correct pdf is shown, so the result is correct.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Create an edge function with return type application/pdf
Return a pdf file as Uint8Array
Invoke the function using the JS supabase library
The result data is a string instead of a blob
Expected behavior
The result should be parsed correctly
System information
"@supabase/supabase-js": "2.38.1"
The text was updated successfully, but these errors were encountered:
Bug report
When returning a buffer in an edge function with type application/pdf, the supabase JS client does not parse the result correctly. It is parsed as a string, but not as a blob.
It is stated here, that the return parsing depends on the content-type of the result, so the application/pdf should be parsed as blob. Instead, it is parsed as a string.
When changing the type to e.g. application/octet-stream, it is correctly parsed as a blob.
So, when using the JS supabase library (await this.supabase.functions.invoke()), it parsed the result incorrectly.
Also, when using e.g. Postman and testing the same function with type application/pdf, the correct pdf is shown, so the result is correct.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
The result should be parsed correctly
System information
The text was updated successfully, but these errors were encountered: