I am encountering some issues while using supabase with TypeScript. Interestingly, I can see the errors in WebStorm, but not in VSCode. Can you provide any assistance?
supabase
.channel('custom-all-channel')
.on(
'postgres_changes',
{ event: '*', schema: 'public', table: 'players_online' },
(payload) => {
if (payload.eventType === 'INSERT') {
players = [...players, { name: payload.new.name, id: payload.new.id }]
}
if (payload.eventType === 'DELETE') {
players = players.filter((pl) => pl.id !== payload.old.id)
}
}
)
.subscribe()
I am facing 2 errors:
- Argument type "postgres_changes" is not assignable to parameter type
${REALTIME_LISTEN_TYPES.BROADCAST}
- Argument type {schema: string, event: string, table: string} is not assignable to parameter type {event: string}
I am unsure of what I might be missing, can you provide any insights?