Skip to content

fix(studio): throw malformed color semantic token with token name#3476

Merged
segunadebayo merged 3 commits intochakra-ui:mainfrom
mateusvelleda:fix/studio-missing-token-reference-not-throwing
Feb 14, 2026
Merged

fix(studio): throw malformed color semantic token with token name#3476
segunadebayo merged 3 commits intochakra-ui:mainfrom
mateusvelleda:fix/studio-missing-token-reference-not-throwing

Conversation

@mateusvelleda
Copy link
Contributor

@mateusvelleda mateusvelleda commented Feb 10, 2026

Closes #

📝 Description

When there is a malformed semantic token it throws the string.match error which doesn't help to debug.

This PR aims to throw the malformed semantic token which is causing the error.

Example:

I had this (wrong) structure in my semanticTokens/colors.ts:

secondary: {
  value: {
    1: {
      base: '{colors.neutral.100}',
      _dark: '{colors.neutral.950}',
    },
    2: {
      base: '{colors.neutral.200}',
      _dark: '{colors.neutral.1000}',
    },
  },
}

when it should be:

secondary: {
  1: {
    value: {
      base: '{colors.neutral.100}',
      _dark: '{colors.neutral.950}',
    },
  },
  2: {
    value: {
      base: '{colors.neutral.200}',
      _dark: '{colors.neutral.1000}',
    },
  },
}

I was struggling to find the error since reference.match doesn't really help

⛳️ Current behavior (updates)

Captura de Tela 2026-02-10 às 09 49 42

🚀 New behavior

Captura de Tela 2026-02-10 às 09 48 35

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 5e75906

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 21 packages
Name Type
@pandacss/studio Patch
@pandacss/astro-plugin-studio Patch
@pandacss/dev Patch
@pandacss/config Patch
@pandacss/core Patch
@pandacss/extractor Patch
@pandacss/generator Patch
@pandacss/is-valid-prop Patch
@pandacss/logger Patch
@pandacss/mcp Patch
@pandacss/node Patch
@pandacss/parser Patch
@pandacss/postcss Patch
@pandacss/preset-atlaskit Patch
@pandacss/preset-base Patch
@pandacss/preset-open-props Patch
@pandacss/preset-panda Patch
@pandacss/reporter Patch
@pandacss/shared Patch
@pandacss/token-dictionary Patch
@pandacss/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
panda-docs Ready Ready Preview Feb 14, 2026 5:11pm

Request Review

@vercel
Copy link

vercel bot commented Feb 10, 2026

@mateusvelleda is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

@segunadebayo segunadebayo merged commit c5061fa into chakra-ui:main Feb 14, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants