-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Failure to parse theme.json should be a lot more obvious #32009
Copy link
Copy link
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] FeedbackIssues that relate purely to feedback on a feature that isn't necessarily actionableIssues that relate purely to feedback on a feature that isn't necessarily actionable
Description
Description
A theme’s global styles are defined in a file called theme.json.
It’s a complicated file in JavaScript Object Notation (JSON ) format.
There are many settings which can have lots of values.
- You have to get the structure and the syntax correct.
- If you make any mistake with the syntax then the Global Styles aren’t set.
- You don’t get any messages.
- Everything just looks all wrong.
- If you do make any changes, use a JSON validator to check your syntax.
- And then check it again for semantics.
You don’t get any messages.
Well, something may be logged to PHP error log.
[19-May-2021 17:06:24 UTC] Error when decoding file schema: Syntax error
Step-by-step reproduction instructions
- Install and activate an FSE theme such as TT1 blocks
- Edit site
- View Global Styles
- Delete the first character from
theme.json - Edit site
- View Global Styles
- Notice the difference
Expected behaviour
The fact that theme.json could not be parsed should be made immediately obvious to the user.
This is going to happen an awful lot in the next few months.
The ability to perform problem determination needs to be significantly improved.
Actual behaviour
It just looks awful.
Screenshots or screen recording (optional)
Screen capture after breaking theme.json in step 4.

Code snippet (optional)
WordPress information
- WordPress version: 5.7.2
- Gutenberg version: 10.6.0
- Are all plugins except Gutenberg deactivated? Yes
- Are you using a default theme (e.g. Twenty Twenty-One)? TT1 blocks
Device information
- Device: Desktop
- Operating system: Windows
- Browser: Chrome
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] FeedbackIssues that relate purely to feedback on a feature that isn't necessarily actionableIssues that relate purely to feedback on a feature that isn't necessarily actionable
Type
Fields
Give feedbackNo fields configured for issues without a type.
