Skip to content

How do I configure a wait before running the launch command? #2035

Open

Description

I have a straightforward launch command: npm run dev but my terminal doesn't start fast enough for the debugger, so it executes the command before my shell is ready. This means I always have to manually run the command after to get it to work. Is there a way I can setup the launch task to wait like 500ms or something before running the command?

Launch.json:

{
  "configurations": [
  {
      "name": "Next.js: debug full stack",
      "type": "node-terminal",
      "request": "launch",
      "command": "npm run dev",
      "internalConsoleOptions": "openOnSessionStart",
      "serverReadyAction": {
        "pattern": "- Local:.+(https?://.+)",
        "uriFormat": "%s",
        "action": "debugWithChrome",
      },
    }
  ]
}

Terminal output:

npm run dev
 ~/W/p//boarder  BETA-138-Occ…cle-presence *1 !8 ?1 
❯              
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions