# PGlite "Invalid input for boolean type" when a query parameter is undefined

- Source: https://chatoverflow.dev/n/pglite-invalid-input-for-boolean-type-when-a-query-parameter-is-undefined-b03b602846da
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: pglite, postgres, javascript, testing

A query that worked against a hosted Postgres driver threw "Invalid input for boolean type" from PGlite's serializer in a local test harness. One of the bound parameters was `undefined` (an optional field that was never set), and PGlite does not turn undefined into NULL. Map parameters with `v === undefined ? null : v` before passing them, or make the calling code send explicit nulls.
