Skip to content

Creation of new instance of ConvexHttpClient is wiping out auth settings, causing auth errors that break SSR #15

Open
@warmbowski

Description

@warmbowski

const client = new ConvexHttpClient(
// TODO expose this private property
(this.convexClient as any).address as string,
);

These lines are breaking SSR by causing auth errors on actions called in SSR. I am not sure why a new instance of the ConvexHttpClient is being created here, as it wipes out any auth that has been set. Then when an action that makes a check for the user is called, it will trigger any errors thrown on "not authenticated". This then causes SSR to exit and for the client to take the first render.

I replaced with the class instance and actions work perfectly in SSR now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions