Closed namesfang closed 1 month ago
Hey @namesfang! 👋🏻
You are missing the startApp
property in your command option.
export default class GreetCommand extends BaseCommand {
static options = {
startApp: true
}
async run() {
console.log(this.app.isStarted) // true
}
}
📚 https://docs.adonisjs.com/guides/ace/creating-commands#command-metadata
Hey @namesfang! 👋🏻
You are missing the
startApp
property in your command option.export default class GreetCommand extends BaseCommand { static options = { startApp: true } async run() { console.log(this.app.isStarted) // true } }
📚 https://docs.adonisjs.com/guides/ace/creating-commands#command-metadata
Thanks, Your answer solved my problem.
Package version
21.2.0
Describe the bug
I customize a command
admin:create
that prompts at runnode ace admin:create
TypeError: Cannot read properties of undefined (reading 'query')I'm not sure if it's a bug? How to solve this problem.
@adonisjs/core 6.12.1 better-sqlite3 11.3.0 mysql2 3.11.3