In SXA 1.8 I had a rendering variant with a VariantSection, with a style
key on the Data attributes field, with value of background-image:url($(PromoImage));background-position: $(Horizontal Focal Point) $(Vertical Focal Point);
This was working totally fine, but when upgrading to SXA 10.1.0 I now get this error:
[ArgumentException: An item with the same key has already been added.]
System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +60
System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14338200
Sitecore.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderRenderingVariantFieldProcessor.GetAttributeTokenValues(Item item, T attributes, Action`3 collectionAction, MatchCollection matches, String value, String key) +326
Sitecore.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderRenderingVariantFieldProcessor.GetAttributeTokenValues(Item item, IDictionary`2 attributes, MatchCollection matches, String value, String key) +219
Sitecore.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderRenderingVariantFieldProcessor.GetVariantAttributes(RenderingVariantFieldBase variantField, Item item, Object model) +319
Sitecore.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderRenderingVariantFieldProcessor.AddWrapperDataAttributes(RenderingVariantFieldBase variantField, RenderVariantFieldArgs args, HtmlGenericControl tag) +49
Sitecore.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +699
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +138
If I change the field to only have one token in it, it works fine. It doesn't matter which token I keep. Why do multiple tokens now break it?