# The no-consent-banner startup warning (and its false positive)

URL: https://kywi-docs-production.up.railway.app/operating/the-no-consent-banner-startup-warning-and-its-false-positive
Type: docPage

One advisory line on the first request reports that nothing places the consent module; it scans stored layouts only, so a banner in app chrome trips it.

One line, once per process, on the first request that reaches the API:

[kywi] Cookie consent is required (theme.personalization.requireConsent) but no page or layout places the `cookieConsent` module, so no visitor can ever grant it. Every personalization cookie stays suppressed: audiences, A/B bucketing and UTM attribution will resolve to default content for everyone. Place the module, or set personalization: { requireConsent: false } if consent is collected by external tooling, or set personalization.consentBanner: 'host' if the banner is mounted in app chrome.

It is advisory and nothing else: never awaited, so the request that triggers it does not wait for the query, and every error it could raise is swallowed. It cannot fail a boot, slow a page, or change what a visitor sees. What it can do is be wrong.

## What it actually looks at

SELECT 1 AS found FROM kywi_content WHERE layout IS NOT NULL AND layout::text LIKE '%"cookieConsent"%' UNION ALL SELECT 1 AS found FROM kywi_section_templates WHERE definition IS NOT NULL AND definition::text LIKE '%"cookieConsent"%' LIMIT 1

Two places a module can be placed — a page's stored layout, and a section template a page composes from — matched as raw text. Nothing else is consulted, and no row is opened to check that the match is a real placement.

## The false positive: a banner in app chrome

There is a third placement the query cannot see. A banner rendered by the host application itself — mounted in the shell so it covers every page, rather than dropped into one page's layout — never appears in a layout document, so the scan finds nothing and warns while the banner is on screen. This site is built that way and logged the warning on every boot until the flag below existed.

personalization: { // The banner is mounted in the app shell, not placed as a layout module. consentBanner: 'host', }

## kywi.config.ts

That is the whole fix, and it is a config change rather than a code one. The check returns before issuing any query at all: the host has declared it handles this itself, so there is nothing in the database to look for. It also stays quiet when the gate is off entirely — the same guard covers both. Where the flag sits in the theme is [Wiring personalization and consent](/developing/wiring-personalization-and-consent/).

## Silence is not evidence that a banner exists

The query has no site, status or deleted-at predicate. One draft, one archived page, one row sitting in the trash — on *any* site in the deployment — whose layout mentions the module is enough to silence the warning for everything. Over-matching is deliberate (a false negative is the safe direction for an advisory), but it means the absence of this line proves nothing about the site a visitor is actually on. Verify a banner by loading the page, not by reading the boot log.

## What it is not

It is not a startup failure, and it is not the consent gate. The two checks that do stop a deploy — sites disagreeing with each other, and the config disagreeing with `KYWI_REQUIRE_CONSENT` — are [Consent policy: the startup-throw and the env mirror](/operating/consent-policy-the-startup-throw-and-the-env-mirror/). This one only decides whether to print a line. When the warning is genuine, though, its subject is real: with consent required and no way to grant it, audiences, A/B bucketing and UTM attribution resolve to default content for every visitor, which reads as a broken personalization setup rather than a gated one ([What consent does to your targeting](/targeting/what-consent-does-to-your-targeting/)).
