TryGhost/Ghost · warning

The URL must be in a format like https://bsky.app/profile/yo

Error message

The URL must be in a format like https://bsky.app/profile/yourUsername

What it means

Thrown by the platform-validator engine for the Bluesky definition when input is URL-shaped but can't be resolved to a valid bsky.app profile URL. Message declared in bluesky.ts ('The URL must be in a format like https://bsky.app/profile/yourUsername'); thrown in platform-validator.ts at: URL regex non-match (line 227 — wrong domain), no path-type match (the 'profile/' prefix) or empty remainder (line 233 — e.g. 'https://bsky.app/' with no profile path, or 'https://bsky.app/profile/' with empty username), or built URL failing validator.isURL (line 263). The path type uses tolerateLeadingAt so a decorative leading @ on the username is stripped; DIDs are lower-cased via transformUsername.

Source

Thrown at apps/admin/src/settings/app/utils/social-urls/bluesky.ts:26

    /^[a-zA-Z0-9._]{1,15}$/,
    // domain handle: requires a dot, max 191 chars
    // (the lookahead does the length check because + is unbounded)
    /^(?=.{1,191}$)[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$/
];

const bluesky = createPlatformValidator({
    domains: ['bsky.app'],
    www: false,
    pathTypes: [
        // bsky.app/profile/@username is a common paste (users type Bluesky
        // handles with a leading @ out of habit); the @ is decorative here,
        // not a marker for a competing path type, so it's still stripped
        {urlPrefix: 'profile/', storagePrefix: '', tolerateLeadingAt: true, rule: {patterns: BLUESKY_USERNAME_PATTERNS}}
    ],
    // DIDs are case-insensitive identifiers, canonically lowercase
    transformUsername: username => (/^did:plc:/i.test(username) ? username.toLowerCase() : username),
    errors: {
        invalidUrl: 'The URL must be in a format like https://bsky.app/profile/yourUsername',
        invalidUsername: 'Your Username is not a valid Bluesky Username'
    }
});

export const validateBlueskyUrl = bluesky.validate;
export const blueskyHandleToUrl = bluesky.handleToUrl;
export const blueskyUrlToHandle = bluesky.urlToHandle;

View on GitHub (pinned to 47d8b0e2ad)

Solutions

  1. Use a profile URL like https://bsky.app/profile/yourUsername (or .bsky.social handle, or did:plc:... DID). A leading @ after profile/ is tolerated.
  2. Confirm the domain is bsky.app and the path starts with profile/.
  3. Ensure the username segment after profile/ isn't empty.
  4. For non-throwing checks, use blueskyUrlToHandle(url) which returns null on invalid input.

Example fix

// before — throws on non-profile or empty-path URL
const normalized = validateBlueskyUrl(value);

// after — non-throwing pre-check, then validate
import {blueskyUrlToHandle, validateBlueskyUrl} from './bluesky';
const trimmed = value.trim();
try {
    if (trimmed && trimmed.includes('://') && blueskyUrlToHandle(trimmed) === null) {
        setFieldError('bluesky', 'Use https://bsky.app/profile/yourUsername');
    } else {
        setNormalized(validateBlueskyUrl(trimmed));
    }
} catch (e) {
    setFieldError('bluesky', e instanceof Error ? e.message : 'Invalid Bluesky URL');
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Non-throwing pre-check using the URL→handle extractor
import {blueskyUrlToHandle} from './bluesky';
function looksLikeBlueskyUrl(input: string): boolean {
    if (!input || !input.includes('://')) return true;
    return blueskyUrlToHandle(input) !== null;
}

Type guard

null

Try / catch

try {
    const normalized = validateBlueskyUrl(value.trim());
} catch (e) {
    setFieldError('bluesky', e instanceof Error ? e.message : 'Invalid Bluesky URL');
}

Prevention

When it happens

Trigger: Input is URL-shaped but: the domain isn't bsky.app; the path doesn't start with 'profile/' (e.g. 'https://bsky.app/'); the remainder after 'profile/' is empty; or the built canonical URL fails validator.isURL. Bare handles that fail BLUESKY_USERNAME_PATTERNS route to invalidUsername. A common paste like 'https://bsky.app/profile/@username' is accepted (leading @ tolerated and stripped).

Common situations: User pasted a Bluesky post/feed URL instead of a profile URL; user entered 'https://bsky.app' with no path; user pasted a URL for a different platform; URL with characters validator.isURL rejects.

Related errors


AI-assisted analysis of TryGhost/Ghost@47d8b0e2ad (2026-08-13). Data as JSON: /api/errors/68eb524589c8570c. Report an issue: GitHub.