oven-sh/bun · error · TypeError

HTTP2Unsupported

HTTP2Unsupported

Error message

HTTP2Unsupported

What it means

The server or client does not support HTTP/2 protocol negotiation (e.g., ALPN did not yield h2). This fires when HTTP/2 was requested but the TLS/ALPN or prior-knowledge handshake did not establish an h2 connection.

Solutions

  1. Fall back to HTTP/1.1 when HTTP/2 is not supported by the server
  2. Verify the server supports HTTP/2 and is configured correctly (ALPN h2 advertisement)
  3. Check that prior-knowledge HTTP/2 connections are enabled if not using ALPN
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/http/error.rs:40 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/dee3a85af8ac9fef. Report an issue: GitHub.

Appendix: source

Thrown at src/http/error.rs:40

    #[error("HTTP2HeaderListTooLarge")]
    HTTP2HeaderListTooLarge,
    #[error("HTTP2StreamReset")]
    HTTP2StreamReset,
    #[error("HTTP2GoAway")]
    HTTP2GoAway,
    #[error("HTTP2CompressionError")]
    HTTP2CompressionError,
    #[error("Timeout")]
    Timeout,
    #[error("AbortedBeforeConnecting")]
    AbortedBeforeConnecting,
    #[error("InvalidURL")]
    InvalidURL,
    #[error("ERR_TLS_CERT_ALTNAME_INVALID")]
    ERR_TLS_CERT_ALTNAME_INVALID,
    #[error("ClientAborted")]
    ClientAborted,
    #[error("HTTP2Unsupported")]
    HTTP2Unsupported,
    #[error("ConnectionClosed")]
    ConnectionClosed,
    #[error("DNSResolveFailed")]
    DNSResolveFailed,
    #[error("ConnectionRefused")]
    ConnectionRefused,
    #[error("TooManyRedirects")]
    TooManyRedirects,
    #[error("HTTP3Unsupported")]
    HTTP3Unsupported,
    #[error("ResponseHeadersTooLarge")]
    ResponseHeadersTooLarge,
    #[error("UnrequestedUpgrade")]
    UnrequestedUpgrade,
    #[error("UnexpectedData")]
    UnexpectedData,
    #[error("InvalidHTTPResponse")]

View on GitHub (pinned to 8c5296ac45)