Can you try x-text="product.options_with_values.find(item => item.name === 'Size').value" instead then? And is the option called "Size" with a capital S? It needs to be exactly the same.
I have a wrapper with the size, with the text element and this li-object attribute value in. Whenever I dont have this varient set, I want to hide the wrapper. How can I do that?
Actually what would be better is just to render a list of wrappers with variant type and variant value in it?
So you could just put an li-unless="item.product.has_only_default_variant" on the wrapper for the visibility
Or, as you said, you could loop over all the options and their respective values like so (li-unless wraps li-for and li-for wraps the other two attributes):