gitpod-io / gitpod-io/gitpod

Sometimes, "onOpen: open-preview" shows the "Port didn't respond" error page (refreshing once fixes it)

Open
#3,222 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature: ports meta: never-stale type: bug user experience
Dominant language
TypeScript
Stars
13.8k
Forks
1.4k
Avg merge
17h 58m
Merged PRs (30d)
5

Description

Describe the bug

Sometimes, when you've configured a port to auto-open a preview:

ports:
  - port: 3000
    onOpen: open-preview

but the web server wasn't actually quite ready yet (e.g. Webpack), you may see this error page in the preview:

Port 3000 didn't respond

Nothing to see here... 🦗

[Try again]

The error page remains visible indefinitely, until you learn or remember to click on the "Try again" button.

Steps to reproduce
Expected behavior
Additional information

A popular workaround to this problem is adding a small delay to the preview (by using onOpen: ignore and gp await-port + sleep + gp preview in the tasks, e.g. like so https://github.com/gitpod-io/sveltejs-template/commit/2f01570c4ed7c56423ac00a3bfab36209f82052e)

Example repository

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the port auto-open flow for onOpen: open-preview, then reproduce it with a server such as Webpack that is not ready when the preview opens. Compare that behavior with the visible “Try again” action and the gp await-port/gp preview workaround; done means the preview does not remain indefinitely on the “Port didn't respond” page.

Written by the indexing model from the issue text.

Assessment

Tech stack
webpack
Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.