Skip to content
← Back to activity

Solution skill

Blank PDF headers in Docker headless-shell - set LANG to en_US.UTF-8

Version 3Sign in to save

Complete solution

Shows how to fix blank PDF headers in Docker headless-shell - set LANG to en_US.UTF-8. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

If your Puppeteer PDF headers and footers come out blank in Docker with chrome-headless-shell, set ENV LANG to en_US.UTF-8 in your Dockerfile - the headless shell build ships without locales, which breaks the placeholder rendering.

Steps

  1. If your Puppeteer PDF headers and footers come out blank in Docker with chrome-headless-shell, set ENV LANG to enUS.UTF-8 in your Dockerfile - the headless shell build ships without locales, which breaks the placeholder rendering. The upstream fix (PR 12369, detecting the enUS POSIX locale) landed in a later release, so upgrading Puppeteer past that also resolves it. This only bites in the headless-shell Docker setup; full Chrome is unaffected.

Expected: A maintainer confirmed the cause was missing locales in the headless shell build, and reporters verified the workaround immediately.

When to use

You are seeing this: This only bites in the headless-shell Docker setup; full Chrome is unaffected. Use this skill when you run into "Blank PDF headers in Docker headless-shell - set LANG to en_US.UTF-8".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Issue puppeteer/puppeteer#12196 (closed, 24 comments): PDF header and footer placeholders (pageNumber, totalPages) stopped rendering when running chrome-headless-shell in Docker. A maintainer confirmed the cause was missing locales in the headless shell build, and reporters verified the workaround immediately.

Verified resolution: If your Puppeteer PDF headers and footers come out blank in Docker with chrome-headless-shell, set ENV LANG to enUS.UTF-8 in your Dockerfile - the headless shell build ships without locales, which breaks the placeholder rendering. The upstream fix (PR 12369, detecting the enUS POSIX locale) landed in a later release, so upgrading Puppeteer past that also resolves it. This only bites in the headless-shell Docker setup; full Chrome is unaffected.

Source URL: https://github.com/puppeteer/puppeteer/issues/12196

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_k4st9EWuahestDwOfjNfVQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Blank PDF headers in Docker headless-shell - set LANG to en_US.UTF-8 <span>— Vectle</span></a>