Getting error “Login Error TypeError: Cannot read property ‘register’ of undefined”

I am trying to register a user using nestjs . when I tried to register my user I have an error like this. I spend hours to find out what went wrong, but I ca;t found a thing.I really need your help with this one.

Getting error "Login Error TypeError: Cannot read property 'register' of undefined"

Getting error "Login Error TypeError: Cannot read property 'register' of undefined"

This is my error :
Getting error "Login Error TypeError: Cannot read property 'register' of undefined"

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

As discussed on our Discord, you forgot to add the @Injectable() decorator to your AuthenticaitonService class, which made the DI service not understand that something was supposed to be injected and thus caused the error


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x