Skip to content
Discussion options

You must be logged in to vote

In getStaticPaths, params.tags shouldn't be an array. Try this.

// pages/tags/[tag].tsx
export const getStaticPaths = async () => {
  const tags = await getAllTags()
  const paths = tags.map(({ tag }) => ({
    params: {
      tag
    },
  }));

  return { paths, fallback: false };
};

In getStaticProps, I don't think includes will work when you're comparing two arrays of tags. Instead, you probably want something like array2.filter(e => !array1.includes(e)).

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@MejanH
Comment options

@leerob
Comment options

@MejanH
Comment options

@leerob
Comment options

Answer selected by MejanH
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants