gofiber/fiber · error · ErrClientNil

client cannot be nil

Error message

client cannot be nil

What it means

Error "client cannot be nil" thrown in gofiber/fiber.

Source

Thrown at client/request.go:42

	Add(name, obj string)
	Del(name string)
}

// bodyType defines the type of request body.
type bodyType int

// Enumeration of request body types.
const (
	noBody bodyType = iota
	jsonBody
	xmlBody
	formBody
	filesBody
	rawBody
	cborBody
)

var ErrClientNil = errors.New("client cannot be nil")

// Request contains all data related to an HTTP request.
type Request struct {
	ctx context.Context //nolint:containedctx // Context is needed to be stored in the request.

	body    any
	header  Header
	params  QueryParam
	cookies Cookie
	path    PathParam

	client *Client

	formData FormData

	RawRequest *fasthttp.Request
	url        string
	method     string

View on GitHub (pinned to 9a4c7e57fe)

When it happens

Trigger: Thrown at client/request.go:42 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gofiber/fiber@9a4c7e57fe (2026-08-04). Data as JSON: /data/errors/39355a16957c24c2.json. Report an issue: GitHub.