Warning Prop `href` did not match

3k views Asked by At

I have a dynamic page route after another dynamic page route. I'm only getting this warning for the second dynamic page route.

Warning: Prop `href` did not match. Server: "/books/category/[category]/filter/[filter]#" Client: "/books/category/literatura-oastei/filter/ceva#"

How to solve this warning?

1

There are 1 answers

2
Gabriel Arghire On

I had to use the fallback property set to blocking inside the getStaticPaths function.

Example:

export const getStaticPaths: GetStaticPaths = async () => {
  return {
    paths: [],
    fallback: 'blocking'
  };
};

Read more about the fallback property here.