jackwener/OpenCLI · error · Error

Unsupported non-Uiverse URL: ${raw}

Error message

Unsupported non-Uiverse URL: ${raw}

What it means

Thrown by parseComponentInput when the input looks like an absolute http(s) URL but its hostname is neither uiverse.io nor www.uiverse.io. The tool only fetches components from uiverse.io and refuses other hosts up front.

Source

Thrown at clis/uiverse/_shared.js:25

const ROUTE_DATA_KEY = 'routes/$username.$friendlyId';
const CODE_DATA_KEY = 'routes/resource.post.code.$id';
const EXPORT_TARGET_BUTTON_LABELS = ['React', 'Vue', 'Svelte', 'Lit'];

function trimPathSegment(value) {
  return String(value || '').trim().replace(/^\/+|\/+$/g, '');
}

export function parseComponentInput(input) {
  const raw = String(input || '').trim();
  if (!raw) {
    throw new Error('Missing component input. Pass a full Uiverse URL or an author/slug identifier.');
  }

  let pathname = raw;
  if (/^https?:\/\//i.test(raw)) {
    const url = new URL(raw);
    if (url.hostname !== 'uiverse.io' && url.hostname !== 'www.uiverse.io') {
      throw new Error(`Unsupported non-Uiverse URL: ${raw}`);
    }
    pathname = url.pathname;
  }

  const cleaned = trimPathSegment(pathname);
  const segments = cleaned.split('/').filter(Boolean);
  if (segments.length !== 2) {
    throw new Error(`Could not parse author/slug from input: ${raw}`);
  }

  const [username, slug] = segments;
  if (!username || !slug) {
    throw new Error(`Invalid component identifier: ${raw}. Expected author/slug.`);
  }

  return {
    raw,
    username,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Use a canonical https://uiverse.io/author/slug URL instead of the alternate host
  2. If the URL is from another site, find the equivalent component on uiverse.io and use its URL/author-slug
  3. Check the hostname spelling — only uiverse.io and www.uiverse.io are accepted
  4. Remove protocol-relative or proxy-prefixed hostnames; input must be a uiverse.io URL or bare author/slug

Example fix

// before
await getPostDetails(page, 'https://codepen.io/user/pen/abc');
// after
await getPostDetails(page, 'https://uiverse.io/pravsingh/sky-button');
Defensive patterns

Strategy: validation

Validate before calling

function isUiverseUrl(input) {
  if (!/^https?:\/\//i.test(input)) return true; // bare author/slug is fine
  const { hostname } = new URL(input);
  return hostname === 'uiverse.io' || hostname === 'www.uiverse.io';
}
if (!isUiverseUrl(input)) input = `https://uiverse.io/${new URL(input).pathname}`; // or reject

Type guard

const isUiverseHost = (url) => {
  try { const h = new URL(url).hostname; return h === 'uiverse.io' || h === 'www.uiverse.io'; }
  catch { return false; }
};

Try / catch

try {
  const details = await getPostDetails(page, input);
} catch (e) {
  if (e.message.startsWith('Unsupported non-Uiverse URL')) {
    console.error('Only uiverse.io URLs are supported; got:', input);
    process.exit(2);
  }
  throw e;
}

Prevention

When it happens

Trigger: Passing a URL from another site (e.g. codepen.io/..., github.com/..., localhost:3000/...) to getPostDetails or a CLI command that parses component input; pasting a URL with a typo in the domain (uiverse.com, uiversei.io); passing a URL behind a different subdomain that is not exactly 'uiverse.io' or 'www.uiverse.io' (e.g. staging.uiverse.io).

Common situations: Copying a component link from a different playground (CodePen, CSS-tricks snippets); using a self-hosted Uiverse clone or mirror; DNS/hosts override sending uiverse.io elsewhere so you substitute an alternate URL; corporate proxy rewrites the domain.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/a5c96cdbd5748db7. Report an issue: GitHub.