Non-UTF-8 source text (Latin-1 CSS/JS/HTML without charset) fails import: 'Runtime declaration payload is not serializable'
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with artifact intake and the referenced paths src/ArtifactCompiler/RuntimeDeclarations.php:576, src/ArtifactCompiler/StagedTransport.php:895, and ThemeScaffold.php:22; trace where HTML, CSS, JS, JSON, and SVG bytes enter the plan. Check how HTML charset metadata is currently handled, then reproduce the listed cases and verify that declared encodings and invalid UTF-8 input are normalized as expected. Done means all four reported cases compile and runtime declaration serialization succeeds.
Written by the indexing model from the issue text.
Description
Summary
Source text that isn't valid UTF-8 (legacy Latin-1/Windows-1252 sites, uploaded zips) fails the whole import instead of being decoded.
Production: two sessions on 2026-11-28 (SSI 1.39.12, upload sources) failed with:
InvalidArgumentException: Runtime declaration payload is not serializable.
at src/ArtifactCompiler/RuntimeDeclarations.php:576 <- :564 <- src/ArtifactCompiler/StagedTransport.php:895
Repro (trunk, ArtifactCompiler::compile)
Each case has one index.html with a single Latin-1 byte (\xE9) somewhere:
| case | result |
|---|---|
Latin-1 byte in a linked s.css |
JsonException: Malformed UTF-8 characters @ ThemeScaffold.php:22 (uncaught) |
Latin-1 byte in a linked a.js |
failed: wordpress_site_plan_not_self_contained, "Runtime declaration payload is not serializable." |
Latin-1 bytes in HTML text and an inline <script>, no charset meta |
failed: same diagnostic |
Same HTML with <meta charset="iso-8859-1"> |
success_with_warnings |
So the HTML path already decodes when a charset is declared. CSS, JS, and undeclared HTML pass raw non-UTF-8 bytes into the plan, and the JSON encoding of runtime declarations, digests and the theme scaffold rejects them.
Expected
Text artifacts (HTML, CSS, JS, JSON, SVG) are normalized to UTF-8 once, at artifact intake. Use the declared encoding where there is one (<meta charset>, CSS @charset, a BOM). Otherwise, for bytes that aren't valid UTF-8, fall back to Windows-1252, a superset of Latin-1 that matches browser behavior for undeclared legacy pages. Everything downstream can then keep assuming UTF-8, and all four cases above compile.
- Dominant language
- PHP
- Stars
- 31
- Forks
- 7
- Avg merge
- 5h 48m
- Merged PRs (30d)
- 796
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#4943 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#4942 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#4921 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
Maintainers usually reply within 1 day
-
perf: a full CSS syntax memo stops memoizing, so per-route stylesheet passes re-split the same selectors (asset_writes, 56-page import)Possibly taken @chubes4 claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Automattic/blocks-engine#7655 ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Codeinwp/optimole-wp#1259 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Sylius/SyliusResourceBundle#1179 ·
-
repo:ckeditor
Difficulty 1/5 Under an hour Newbie friendliness 78/100
craftcms/ckeditor#682 · 1 comment ·
Maintainers usually reply within 1 day