Skip to content

No client method with the name found #3

@barrettg

Description

@barrettg

Hello -

I'm trying to implement the useSignalREffect hook of this module and I'm having difficulting getting it to fire. Per the example, I've created a provider and I am successfully using the SignalRContext.invoke() method to send messages to my server. However, when messages come back, the hook is not firing and I am seeing the warning "No client method with the name "..." found" in the console window.

image

I have defined both Message callbacks in my hub definition:
const SignalRContext = createSignalRContext<SMS>();

export interface SMS {
    callbacksName: SMSEventNames;
    callbacks: SMSCallbacks;
   /** Invokes hidden **/
}

// Events from Sever to Client
export enum SMSEventNames {
    message = 'Message', // Get a message
    messageList = 'MessageList', // Get a message list
}
export type SMSCallbacks = {
    [SMSEventNames.message]: (value: string) => void;
    [SMSEventNames.messageList]: (value: string[]) => void;
};

Is there another step I am missing to wire up the hook? Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions