Theme product-form variants() returns "error: is empty" if used on a product that has no variant options
I get it... the product has no variants so it shouldn't return a variant object. But I think it should return null so we can check for that easily. Or alternatively, return the equivalent of {{ product.selected_or_first_available_variant.id }} which defaults to the default option in products without variants.
This is in slate starter theme if that matters. Standard product.liquid page and the only code changes I made to /scripts/sections/product.js was to add window.variantId = productForm.variants() to the onLoad method and to the onFormOptionChange method so the variant ID would always be globally available.
I commented on the related issue: https://github.com/Shopify/theme-scripts/issues/91#issuecomment-517408590