Skip to content

unable to parse URL from normalized contextURL: 'snapshot/1234-abcd' TypeError: URL constructor: snapshot/1234-abcd is not a valid URL. #8411

@jankeromnes

Description

@jankeromnes

Bug description

There is a new error being logged in workspaces list when you've opened a snapshot before. This also causes the displayed workspace context URL to be undefined:

Screenshot 2022-02-23 at 15 21 18

Screenshot 2022-02-23 at 15 21 06

Steps to reproduce

  1. Open a snapshot in Gitpod
  2. Open your Workspaces list

Workspace affected

No response

Expected behavior

Instead of trying to parse the snapshot/1234-abcd context as a URL, and showing undefined as the context, the workspaces list should just show snapshot/1234-abcd as plain text (not a link) for snapshots here:

const normalizedContextUrl = ContextURL.getNormalizedURL(ws)?.toString() || "undefined";

<a href={normalizedContextUrl}>
<div className="text-sm text-gray-400 dark:text-gray-500 overflow-ellipsis truncate hover:text-blue-600 dark:hover:text-blue-400">{normalizedContextUrl}</div>
</a>

Example repository

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions