3

We have a LWC that has not changed for months that includes a reference to the $font-size-7 design token:

.notes-output__span {
    min-height: calc(var(--lwc-varFontSize7,1.25rem) + 1px);
}

and builds this morning are now failing with the error:

No TOKEN named force:base.varFontSize7 found

Anyone else having a similar problem? (Hoping it is a transitory build environment error rather than an obscure symptom of a change we have made.)

3
  • interestingly, varFontSize is not listed as a global LDS token so I would expect this error as noted here. Do you have a support case? Mar 1, 2022 at 19:14
  • Hi @KrisGoncalves, This is a component created by an outside company that we think we can deprecate; interesting that perhaps should never have worked which makes getting rid of it more attractive.
    – Keith C
    Mar 1, 2022 at 22:50
  • 1
    I am facing a similar issue in one of the lwc. Strangely, this error was not reported when deployed before Spring '22 release, which makes me think, if this could be something Salesforce started enforcing in Spring '22 release. Not sure, though!
    – Amudh
    Mar 4, 2022 at 5:27

1 Answer 1

4

Design Tokens lists varFontSize7 not globally accessible.

Based on Use Lightning Design System Design Tokens, this should throw the error you're seeing

IMPORTANT If you get the error: No TOKEN named tokenName found, it's likely that you're using a token that isn't marked Global Access. Either use a global token or use a custom Aura design token.

So, the error message you started to receive is technically correct. However, it seems there's been a gap in the above validation - where non-globally accessible tokens in css formulas (ex. calc) have gotten passed this validation.

An update essentially started catching the above scenario which is why some of these LWCs have started to throw this error. It's been reverted so you shouldn't be seeing these errors. If you are, I'd suggest putting in a support case.

In the end, if you did get this error - I would consider updating your LWC as I'm not sure what the future behavior will be.

1
  • Do you know why there are internal as well as global tokens? Sep 20 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .