AdonisJs Ace - E_IOC_LOOKUP_FAILED

Viewed 604

I'm trying to load the Event system into an ace command.

public async run() {
    const { default: Event } = await import('@ioc:Adonis/Core/Event')
}

However this results in the following error: Cannot resolve "Adonis/Core/Event" namespace from the IoC Container

Based on the documentation I'm doing this right: https://docs.adonisjs.com/guides/ace-commandline#top-level-imports-are-not-allowed

Could anyone please advise?

2 Answers

Try this commandit solve your issue.

node ace generate:manifest

Set loadApp in your command settings property to true.

Then, run the command node ace generate:manifest.

Related