Skip to content

Cannot read properties of undefined (reading 'singleton') #3473

Answered by Julien-R44
marcelodelta asked this question in Help
Discussion options

You must be logged in to vote

This syntax is now deprecated :
https://docs.adonisjs.com/releases/out-of-preview#application-bootstrap-process

You can do it like this :

export default class AppProvider {
  constructor(protected app: ApplicationContract) {}

  public register() {
    this.app.container.singleton('Front/RegraService', () => new RegraService())
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marcelodelta
Comment options

Answer selected by marcelodelta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants