You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After dev server started, open a second terminal and run:
npx nitro task run example
Describe the bug
In the current beta version and main branch it is not possible to run tasks via the CLI, e.g.: npx nitro task run example (doesn't matter which package manager you use).
The CLI runs the command using POST, while on the Dev Server only GET is registered, so it doesn't work.
When the dev server runs, open a second terminal as seen in the screenshot and try to run the example command.
Additional context
No response
Logs
❯ npx nitro task run example
[2:12:34 PM] ℹ Using index.html as renderer template.
[2:12:34 PM] ℹ Running task example...
[2:12:34 PM] ERROR Failed to run task example: Error: Not Found
I reproduced from the StackBlitz repro: npx nitro task run example fails in dev mode with Not Found.
From initial inspection, CLI task execution uses POST while the dev task route appears to expose GET.
Proposed fix direction:
align dev endpoint and CLI method semantics for task execution
add a regression test to cover nitro task run <name> against dev server
Can a maintainer confirm this is the preferred direction before I open a draft PR?
Activity
parallax1s commentedon Apr 8, 2026
I’d like to work on this.
I reproduced from the StackBlitz repro:
npx nitro task run examplefails in dev mode withNot Found.From initial inspection, CLI task execution uses
POSTwhile the dev task route appears to exposeGET.Proposed fix direction:
nitro task run <name>against dev serverCan a maintainer confirm this is the preferred direction before I open a draft PR?
jkniest commentedon Apr 8, 2026
Yeah, thats what I wrote above 😅 I already have an PR open fyi #4188 – maybe you can have a look and see if it fits your idea?
Thanks!