Facing Error while using generateStaticParams() in Next js for ghost

Hello Everyone!!
I’m facing a problem while generating static prams in next js for a single post of ghost.

export async function generateStaticParams() {

  try {
    const posts = await getPosts();
    return posts.map((post) => ({
      slug: post.slug,
  } catch (error) {

  // return [{ tag: "tag1" }, { tag: "tag2" }].map((item) => ({ tag: item.tag }));


import GhostContentAPI from "@tryghost/content-api";

// Create API instance with site credentials
const api = new GhostContentAPI({
  url: "http://localhost:2368",
  key: "XXX",
  version: "v5.0",

export async function getPosts() {
  return await api.posts
      limit: "all",
      include: "tags"
    .catch((err) => {

The error I’m getting is as:

Also when I normally fetch posts using useEffect of a normal page it works fine.

so can anyone tell me what is the problem?

I would research the Axios errors at the top of your screenshot:

“adapter xhr is not supported by the environment”
“adapter http is not available in the build”.

Yeah the Axios error is coming form the ghost only

Not exactly, it’s coming from Axios, a Ghost dependency.

I suggest looking into why the Axios xhr is not supported in your environment or why the Axios http adapter is not supported in your build.

Clearly you are using Windows. You could try Windows WSL if running Ghost directly on Windows is not working.