Skip to content

Reproducible error example code for Next13 and URQL

Notifications You must be signed in to change notification settings

shkim/urql-next13-error

Repository files navigation

This is a reproducible example code which uses URQL with Next.js (v13, App Router) framework.

Reproduction Steps:

  1. Run app
$ npm install
$ npm run dev
  1. Open a web browser and visit http://localhost:3000 then open Developer Tools.

  2. Click the link that will lead you to '/query' page.

  3. Check the console messages. (Sometimes it works fine but Reload will trigger the Problem.)

import { createUrqlClientAndSsr } from "@/graphql";

export default function GqlProvider({ children }: React.PropsWithChildren) {
  const [client, ssr] = React.useMemo(() => {
    console.log("GqlProvider useMemo called");
    return createUrqlClientAndSsr();
  }, []);

  return (
    <UrqlProvider client={client} ssr={ssr}>
      {children}
    </UrqlProvider>
  );
}

  • I don't know why GqlProvder is initializing infinitely.

About

Reproducible error example code for Next13 and URQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages