Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
balloman opened this issue Jul 9, 2024 · 1 comment
Open

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

balloman opened this issue Jul 9, 2024 · 1 comment

Comments

@balloman
Copy link

balloman commented Jul 9, 2024

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 
❯              
@connor4312
Copy link
Member

connor4312 commented Jul 9, 2024

There's no such option.

One option is to use the node launch type which avoids using a terminal and should be overall faster

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants