Cannot read properties of undefined (reading 'singleton') #3473
Answered
by
Julien-R44
marcelodelta
asked this question in
Help
-
An error occurs when tender registers a singleton-type Service. I'm using IocContract AppProvider
Error |
Beta Was this translation helpful? Give feedback.
Answered by
Julien-R44
Jan 5, 2022
Replies: 1 comment 1 reply
-
This syntax is now deprecated : You can do it like this : export default class AppProvider {
constructor(protected app: ApplicationContract) {}
public register() {
this.app.container.singleton('Front/RegraService', () => new RegraService())
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
marcelodelta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This syntax is now deprecated :
https://docs.adonisjs.com/releases/out-of-preview#application-bootstrap-process
You can do it like this :