Skip to content

TypeError: resolveDispatcher() is null with React example in NextJS page router (v15.0.3) #40

@AndrewNow

Description

@AndrewNow

Hey all, I've used this package successfully in an app router project but am struggling to get this to work in a page router project.

At first, I was getting the following with the import statement used in the example:

Error: You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps /

Then, attempting NextJS dynamic import I would get the following error.
Image

const MeshGradient = dynamic(
  () => import('@paper-design/shaders-react').then((mod) => mod.MeshGradient),
  {
    ssr: false,
    loading: () => <div className="w-[500px] h-[200px]" />,
  }
)

[...]

<MeshGradient
  color1="#FFC0CB"
  color2="#FFFF00"
  color3="#0000FF"
  color4="#800080"
  speed={0.25}
  style={{ width: 500, height: 200 }}
/>

Any advice would be greatly appreciated!

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