TypeError: Cannot read properties of undefined (reading 'api') at Object.getApiDocumentationPath

I’m getting this errors when running the strapi app in development mode.
This is the stack trace -
error: Cannot read properties of undefined (reading ‘api’)
TypeError: Cannot read properties of undefined (reading ‘api’)
at Object.getApiDocumentationPath (my-app\node_modules@strapi\plugin-documentation\server\services\documentation.js:88:40)
at Object.generateFullDoc (my-app\node_modules@strapi\plugin-documentation\server\services\documentation.js:140:43)
at Object.module.exports [as bootstrap] (my-app\node_modules@strapi\plugin-documentation\server\bootstrap.js:53:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.bootstrap (my-app\node_modules@strapi\strapi\lib\core\domain\module\index.js:40:7)

I have been using these version of strapi and plugins -
@strapi/plugin-documentation”: “^4.3.6”,

"@strapi/plugin-i18n": "4.2.3",

"@strapi/plugin-users-permissions": "4.2.3",

"@strapi/provider-email-sendgrid": "^4.3.6",

"@strapi/strapi": "4.2.3",

Please tell how to resolve this issue.