codesandbox / codesandbox-client

An online IDE for rapid web development
https://codesandbox.io
Other
13.08k stars 2.28k forks source link

Disable preview for a task in the tasks.json #8256

Open noam-honig opened 9 months ago

noam-honig commented 9 months ago

🐛 bug report

Preflight Checklist

Description of the problem

I have two tasks, one for the frontend (port:5173) and one for the api server (3002). I've configured my tasks.json without a preview for the api task - but it stills open the preview - how do I disbale that?

How has this issue affected you? What are you trying to accomplish?

Everytime I open this sandbox - I get an error because it opens two previews - one with the error

To Reproduce

The task dev-node doesn't have a preview setting - but still opens a preview for the port it opens (3002) tasks.json

{
  // These tasks will run in order when initializing your CodeSandbox project.
  "setupTasks": [
    {
      "name": "Install Dependencies",
      "command": "yarn install"
    }
  ],

  // These tasks can be run from CodeSandbox. Running one will open a log in the app.
  "tasks": {
    "dev": {
      "name": "dev",
      "command": "yarn dev",
      "runAtStart": true,
      "preview": {
        "port": 5173
      }
    },
    "dev-node": {
      "name": "dev-node",
      "command": "yarn dev-node",
      "runAtStart": true
    }
  }
}

Link to sandbox: [link]() (optional)

https://codesandbox.io/p/devbox/github/remult/react-vite-express-starter/tree/master/?file=%2F.codesandbox%2Ftasks.json%3A1%2C1-27%2C1

Your Environment

Software Name/Version
Сodesandbox
Browser
Operating System
JamesACS commented 9 months ago

Hello @noam-honig - I've confirmed this on our end, it seems to be something to do with the app.listen function.

I've flagged it with our team

noam-honig commented 9 months ago

@JamesACS thanks - I'm looking forward to hearing from you