Error: strapiServer is not a function

System Information
  • Strapi Version: 4.0.0
  • Operating System: Ubuntu 20.04
  • Node Version: 14.0

I am trying to extend the users-permissions plugin, but am stuck. When trying to make the strapi-server.js file in the “src/extensions/users-permissions” directory. The error I am getting is: “strapiServer is not a function” and the server crashes.

The problem was that the file was empty. As soon as you write the code in it(module.exports = plugin …) and start the server, it works fine.

Can you show the code you have in your strapi-server.js file? I’m having the same issue.

what do you mean by “the file was empty”? Can you show us your solution?

I encountered a similar issue and managed to resolve it by following these steps:

  1. I copied the existing “strapi-server.js” file.
  2. Then, I pasted the copied file in the “src/extensions/users-permissions” directory.
  3. After that, I changed the extension of the pasted file from “.js” to “.ts”.
  4. Finally, this solution successfully resolved the issue for me.