supabase / functions-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`super` keyword type error

bombillazo opened this issue · comments

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When trying to compile our Next.js app which uses the supabase client, we are getting the following build/lint error:

./node_modules/@supabase/functions-js/src/types.ts:21:11
Type error: Only public and protected base class methods are accessible via the 'super' keyword.

  19 |   constructor(message: string, name = 'FunctionsError', context?: any) {
  20 |     super(message)
> 21 |     super.name = name
     |           ^
  22 |     this.context = context
  23 |   }
  24 | }

To Reproduce

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

  1. N/A

Expected behavior

No type errors occur.

Im sure the fix is:

//replace 
super.name = name 

// with
this.name = name

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • Version of supabase-js: 2.24.0

Additional context

Add any other context about the problem here.

Hey @inian @soedirgo , does this look ok?

Merged the PR, thanks!