Cannot read property 'routes' of undefined - Strapi Documentation Plugin

System Information
  • Strapi Version:
    4.1.5
  • Operating System:
    Windows 10
  • Database:
    SQLite
  • Node Version:
    14.18.1
  • NPM Version:
    6.14.13
  • Yarn Version:
    not installed

Hi,
I am getting this error message after fresh installation of @strapi/plugin-documentation v4.1.5 and command npm run develop

[2022-03-25 14:33:45.523] debug: ⛔️ Server wasn't able to start properly.
[2022-03-25 14:33:45.525] error: Cannot read property 'routes' of undefined
TypeError: Cannot read property 'routes' of undefined
    at getPaths (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\plugin-documentation\server\utils\builders\build-api-endpoint-path.js:83:27)
    at module.exports (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\plugin-documentation\server\utils\builders\build-api-endpoint-path.js:175:10)
    at Object.generateFullDoc (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\plugin-documentation\server\services\documentation.js:132:32)
    at async Object.module.exports [as bootstrap] (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\plugin-documentation\server\bootstrap.js:52:3)
    at async Object.bootstrap (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\strapi\lib\core\domain\module\index.js:40:7)
    at async Object.bootstrap (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\strapi\lib\core\registries\modules.js:28:9)
    at async Strapi.runLifecyclesFunctions (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\strapi\lib\Strapi.js:466:5)
    at async Strapi.bootstrap (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\strapi\lib\Strapi.js:404:5)
    at async Strapi.load (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\strapi\lib\Strapi.js:413:5)
    at async Strapi.start (H:\Documents\Repositories\rhesecure-webservice\rhesecure-db-ws\node_modules\@strapi\strapi\lib\Strapi.js:161:9)

Generation of Documentation stops at my own routes file which is created after strapi v4 documentation and working fine.

'use strict';

module.exports = {
  routes: [
    {
      /**
         * @description LOGIN ENDPOINT
         * Prüft Email, Passwort, geblockt Status und sendet bei erfolgreichem Login den JWT Token zur Authentifizierung
         * @parameter siehe OpenAPI swagger Doku
         * @return siehe OpenAPI swagger Doku
        */
      method: 'POST',
      path: '/authentication/login',
      handler: 'authentication.login',
      config: {
        auth: false, //Aktion vor dem Login
        description: 'Authentifizierung eines Benutzers',
        tag: {
          name: 'Authentication'
        }
      }
    },
    {
      /**
         * @description PASSWORT VERGESSEN ENDPOINT
         * Prüft Email, geblockt Status und sendet bei Erfolg eine EMail mit neuem Passwort
         * @parameter siehe OpenAPI swagger Doku
         * @return siehe OpenAPI swagger Doku
        */
      method: 'POST',
      path: '/authentication/reset-password',
      handler: 'authentication.resetPassword',
      config: {
        auth: false, //Aktion vor dem Login
        description: 'Sendet eine E-Mail mit einem neuen Passwort',
        tag: {
          name: 'Authentication'
        }
      }
    }
  ]
};

This is just an own auth without content-type
image

Hope you can help me.

Tested a lot of stuff and found following behaviour:

When I add a content type to authentication an create core routes and core controllers, the documentation plugin then generates a doc for these.
My custom routes in an additional custom-routes.js within the routes folder are still ignored by the documentation but the error is not ocurring anymore.

Is it true that the current version of the documentation plugin can only document core routes?
I cant find any information on this on the plugins info page.