Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from 3.0.6 to 3.1.1 caused custom user controllers error: Error creating endpoint post /users: handler not found #7196

Closed
andylacko opened this issue Jul 27, 2020 · 7 comments · Fixed by #7212
Labels
issue: discussion A general discussion issue

Comments

@andylacko
Copy link

Hello, when updated to 3.1.1, server does not start, this is as much info as I discovered

Describe the bug

this is how my api/user/controllers/user.js looks like

'use strict';

module.exports = {
  getUser: async ctx => {
    ctx.send('controlled by GraphQl')
  },
  getPortalSession: async ctx => {
    ctx.send('controlled by GraphQl')
  },
}

after upgrading to 3.1.1 can't start server, error

Error creating endpoint post /users: handler not found "user.create"

is shown also when cleaned cache. It seems like it's not extending the object, but replacing with custom defined by me

Steps to reproduce the behavior

  1. npx strapi generate:controller user
  2. create custom controller function
  3. run server

Expected behavior

to run server and be able to set permissions in admin

System

  • Node.js version: 14.6.0
  • NPM version: 6.14.7
  • Strapi version: 3.1.1
  • Database: sqlite
  • Operating system: Mac Os
@derrickmehaffy
Copy link
Member

Node.js version: 14.6.0

Please downgrade your node version to the latest supported LTS (v12) and test again

@andylacko
Copy link
Author

andylacko commented Jul 27, 2020

downgraded to v12.18.3, still error Error creating endpoint post /users: handler not found "user.create" shows, no difference

@lauriejim lauriejim added the issue: discussion A general discussion issue label Jul 27, 2020
@lauriejim
Copy link
Contributor

Thank you for reporting this issue. Related to the API name probable - conflicting with the User model in the Users & Permissions plugin I guess.

@alexandrebodin Can you please confirm it's related to that.
I can confirm it was possible before.
Should we convert this as an issue @alexandrebodin ?

@alexandrebodin
Copy link
Member

@andylacko do you have a routes.json file to share ?

@andylacko
Copy link
Author

@alexandrebodin , I have no routes.json file inside user/config folder, we only use graphQl

@alexandrebodin
Copy link
Member

OK @andylacko I can make a fix for this issue but I would still recommend you rename the controller to my-user.js to avoid any conflict with the admin users :)

@andylacko
Copy link
Author

oh nice, I see what you mean, will rename it 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: discussion A general discussion issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants