Skip to content

Can't call mutationOptions({}) from a context in Solidjs (SolidStart). In vercel deployment. #1494

@renatonmag

Description

@renatonmag

"@orpc/client": "^1.13.5", "@orpc/server": "^1.13.5"
I have this code here:

import { useMutation } from "@tanstack/solid-query";
import { orpc } from "~/lib/orpc";

export function useUpdateComponent() {
  const updateComponent = useMutation(() =>
    orpc.component.update.mutationOptions({}),
  );

  return updateComponent;
}
export const _StoreContext = createContext<IStoreContext>();
export const StoreContext = (props: any) => {
  const fns = useUpdateComponent();
  const store = createApplicationStore();
  return (
    <_StoreContext.Provider value={store}>
      {props.children}
    </_StoreContext.Provider>
  );
};

I don't use fns for nothing but the call to mutationOptions({}) blocks the page load in vercel deployment.
StoreContext is inside a QueryClientProvider.
Not sure what is the problem here, but I can't call mutationOptions({}) inside a context. This problem does not occur in local development only in the vercel deployment. I'm using solidstart

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions