-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
node
- Rivet Cloud
- Game ID: [please provide]
- Rivet self-hosted local
- Version/commit: 0.9.8
- Rivet self-hosted cluster
- Version/commit: [please provide]
Description
following the given example, gives me a typescript error:
// in registry.ts
import {actor, setup} from '@rivetkit/actor'
export const counter = actor({
onAuth: () => {}, // Skip authentication (can be configured later)
state: {count: 0},
actions: {
increment: (c, amount: number = 1) => {
c.state.count += amount
c.broadcast('countChanged', c.state.count)
return c.state.count
},
getCount: c => c.state.count,
},
})
export const registry = setup({
use: {counter},
})
// in hook.ts
import {createClient, createRivetKit} from '@rivetkit/react'
import type {registry} from './registry'
export const client = createClient<typeof registry>('http://localhost:8080')
export const {useActor} = createRivetKit(client)
the TS error:
Type 'Registry<{ counter: ActorDefinition<{ count: number; }, unknown, unknown, unknown, unknown, void, AnyDatabaseProvider, { increment: (c: ActionContext<{ count: number; }, unknown, unknown, unknown, unknown, void, AnyDatabaseProvider>, amount?: number) => number; getCount: (c: ActionContext<...>) => number; }>; }>' does not satisfy the constraint 'Registry<any>'.
Property '#private' in type 'Registry' refers to a different member that cannot be accessed from within type 'Registry'.ts(2344)
(alias) const registry: Registry<{
counter: ActorDefinition<{
count: number;
}, unknown, unknown, unknown, unknown, void, AnyDatabaseProvider, {
increment: (c: ActionContext<{
count: number;
}, unknown, unknown, unknown, unknown, void, AnyDatabaseProvider>, amount?: number) => number;
getCount: (c: ActionContext<...>) => number;
}>;
}>
import registry
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working