Skip to content

Commit 93cdddd

Browse files
authored
Improve error message for missing variant
1 parent 7de7345 commit 93cdddd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/substituteVariantsAtRules.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export default function(config, { variantGenerators: pluginVariantGenerators })
7878
}
7979

8080
_.forEach(_.without(ensureIncludesDefault(variants), 'responsive'), variant => {
81+
if (!variantGenerators[variant]) {
82+
throw new Error(`Your config mentions the "${variant}" variant, but "${variant}" doesn't appear to be a variant. Did you forget or misconfigure a plugin that supplies that variant?`);
83+
}
8184
variantGenerators[variant](atRule, config)
8285
})
8386

0 commit comments

Comments
 (0)