@tryghost/content-api is not working on Next v14

I am trying to fetch the post data by ghost content API but when I try does not work. I follow this instruction but I got this error every time, check the error below,

AxiosError: There is no suitable adapter to dispatch the request since :
- adapter xhr is not supported by the environment
- adapter http is not available in the build
    at Object.getAdapter (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:2473:13)
    at Axios.dispatchRequest (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:2523:28)
    at Axios._request (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:2906:33)
    at Axios.request (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:2776:25)
    at Axios.<computed> [as get] (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:2932:17)
    at Function.wrap [as get] (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:7:15)
    at defaultMakeRequest (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:3367:25)
    at makeApiRequest (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:3515:12)
    at Object.browse (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:3467:14)
    at eval (webpack-internal:///(ssr)/./src/lib/posts.js:22:11)
    at (ssr)/./src/lib/posts.js (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/.next/server/app/(rootTemplate)/blog/page.js:202:1)
    at __webpack_require__ (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///(ssr)/./src/app/(rootTemplate)/blog/page.jsx:7:68)
    at (ssr)/./src/app/(rootTemplate)/blog/page.jsx (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/.next/server/app/(rootTemplate)/blog/page.js:140:1)
    at Object.__webpack_require__ [as require] (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/.next/server/webpack-runtime.js:33:42)
    at require (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:39:19604)
    at /Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:108279
    at eo (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:108464)
    at /Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:110693
    at Object._fromJSON (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:111249)
    at JSON.parse (<anonymous>)
    at eu (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:108958)
    at en (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:108026)
    at /Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:115168
    at /Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:115185
    at /Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:115218
    at /Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:115235
    at t (/Users/Rodrigo.Sousa/Documents/projects/lp-acao-amazonia/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:115458)
    at Axios.request (webpack-internal:///(ssr)/./node_modules/@tryghost/content-api/es/content-api.js:2781:41) {
  code: 'ERR_NOT_SUPPORT'
}

i´m using Next.js in version 14

this is my package.json file


{
  "name": "fire-banking",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@tryghost/content-api": "^1.11.21",
    "axios": "^1.6.8",
    "keen-slider": "^6.8.6",
    "next": "^14.2.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^5.0.1"
  },
  "devDependencies": {
    "@cloudflare/next-on-pages": "^1.11.0",
    "@types/react": "^18.2.66",
    "@types/react-dom": "^18.2.22",
    "@vitejs/plugin-react": "^4.2.1",
    "eslint": "^8.57.0",
    "eslint-plugin-react": "^7.34.1",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.6",
    "sass": "^1.72.0",
    "vite": "^5.2.0"
  }
}

Can anyone help me?

I´ve tried to use NExt v13 and it works

Take a look at this post, you have to provide a makeRequest override to the API:

I´ve tried but with no success, i will keep using the next v13 because is working.

Thanks for your reply

What have you tried? If you don’t post examples, you won’t be able to get help :wink: