Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call rpc void function returns json parsing error #132

Closed
phamhieu opened this issue Feb 22, 2021 · 0 comments · Fixed by supabase/postgrest-js#156
Closed

Call rpc void function returns json parsing error #132

phamhieu opened this issue Feb 22, 2021 · 0 comments · Fixed by supabase/postgrest-js#156
Labels
bug Something isn't working

Comments

@phamhieu
Copy link
Member

Bug report

Describe the bug

My store_sentry_event function used to be defined like this:

create or replace function public.store_sentry_event(json_content jsonb)
  returns void security definer
  language sql
as $$
  insert into private.sentry_event (received, content)
  values(transaction_timestamp(), json_content);
$$;

But I noticed that my code that calls that function directly via SupbaseClient.rpc() started failing with error:

Uncaught (in promise) SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

supabase/supabase#762

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a void function
  2. Call void function from supabase client
  3. See Json pasing error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant