Search code examples
mongodbstrapi

Strapi Server wasn't able to start properly. /documentation/: policy.split is not a function


I recently encountered this error while starting strapi app. Everything was fine before. I have been searching but still no clue how to solve this. Has anyone encountered this error before?

> strapi start

[2021-01-23T11:19:49.618Z] debug ⛔️ Server wasn't able to start properly.
[2021-01-23T11:19:49.619Z] error Error creating endpoint get /documentation/: policy.split is not a function or its return value is not iterable

Please note that my app has no path /documentation. Except for strapi default path for its documentation.

Here my app dependencies, I tried with node 10, 12, 14, 15. All have the same error:

    "dateformat": "^3.0.3",
    "excel4node": "^1.7.2",
    "nodemailer": "^6.4.11",
    "os": "^0.1.1",
    "sha256": "^0.2.0",
    "strapi": "3.0.0-beta.20.3",
    "strapi-admin": "3.0.0-beta.20.3",
    "strapi-connector-mongoose": "3.0.0-beta.20.3",
    "strapi-plugin-content-manager": "3.0.0-beta.20.3",
    "strapi-plugin-content-type-builder": "3.0.0-beta.20.3",
    "strapi-plugin-documentation": "^3.0.0-beta.20.3",
    "strapi-plugin-email": "3.0.0-beta.20.3",
    "strapi-plugin-upload": "3.0.0-beta.20.3",
    "strapi-plugin-users-permissions": "3.0.0-beta.20.3",
    "strapi-utils": "3.0.0-beta.20.3",
    "uuid": "^8.3.1",
    "xlsx": "^0.16.5"

Solution

  • Please follow these steps:

    1. Replace ^3.0.0-beta.20.3 with 3.0.0-beta.20.3 from strapi-plugin-documentation dependency. (Notice the removal of ^).
    2. Remove package-lock.json or yarn.lock file.
    3. Reinstall the dependencies.

    Now re-run Strapi and the issue must be resolved.