lissy93/web-check · error

No URL specified

Error message

No URL specified

What it means

The shared Vercel middleware extracts the raw url from the request, applies shouldSkip, and if rawUrl is falsy responds 500 with { error: 'No URL specified' }. Unlike sibling handlers this is a returned HTTP 500 response, not a thrown exception, and only fires when shouldSkip did not already short-circuit.

Source

Thrown at api/_common/middleware.js:62

    return new Promise((_, reject) => {
      setTimeout(() => {
        reject(new Error(`Request timed-out after ${timeoutMs} ms`));
      }, timeoutMs);
    });
  };

  // Vercel
  const vercelHandler = async (request, response) => {
    const queryParams = request.query || {};
    const rawUrl = queryParams.url;

    const { skip, reason } = shouldSkip(request.url, rawUrl);
    if (skip) {
      return response.status(200).json({ skipped: reason });
    }

    if (!rawUrl) {
      return response.status(500).json({ error: 'No URL specified' });
    }

    try {
      const url = normalizeUrl(rawUrl);
      const result = await Promise.race([handler(url, request), createTimeoutPromise(TIMEOUT)]);
      response.status(200).json(typeof result === 'object' ? result : JSON.parse(result));
    } catch (error) {
      const isTimeout = error.message.includes('timed-out') || response.statusCode === 504;
      const message = isTimeout ? `${error.message}\n\n${timeoutErrorMsg}` : error.message;
      response.status(isTimeout ? 408 : 500).json({ error: message });
    }
  };

  // Netlify
  const netlifyHandler = async (event, context) => {
    const queryParams = event.queryStringParameters || event.query || {};
    const rawUrl = queryParams.url;

View on GitHub (pinned to af1a97759f)

Solutions

  1. Always include ?url=<target> in requests to middleware-wrapped endpoints
  2. For uptime monitors, use a dedicated health path or add the endpoint to skip rules rather than passing no url
  3. Client-side, validate presence of the param before issuing the request

Example fix

// before
fetch('/api/status'); // 500 { error: 'No URL specified' }

// after
if (!targetUrl) throw new Error('target url required');
fetch(`/api/status?url=${encodeURIComponent(targetUrl)}`);
Defensive patterns

Strategy: validation

Validate before calling

const url = new URL(request.url, 'http://x').searchParams.get('url');
if (!url) return badRequest('url query parameter is required');
const out = await fetch(endpoint + '?url=' + encodeURIComponent(url));

Type guard

const hasUrlQueryParam = (u) => new URL(u, 'http://x').searchParams.has('url');

Try / catch

const r = await fetch(ep);
if (r.status === 500) { const b = await r.json(); if (b.error === 'No URL specified') return badRequest('missing ?url='); }
throw new Error(`unexpected ${r.status}`);

Prevention

When it happens

Trigger: Any request to an endpoint wrapped by this middleware that carries no url query parameter and does not match the skip rules.

Common situations: Curl/browser probes hitting the endpoint root without ?url=, monitoring health checks that ping the path bare, or client code reading the wrong query key before calling.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of lissy93/web-check@af1a97759f (2026-08-27). Data as JSON: /api/errors/2733e0e258d984fa. Report an issue: GitHub.