Skip to content

Commit

Permalink
Improve error message for missing variant
Browse files Browse the repository at this point in the history
  • Loading branch information
davewasmer committed May 5, 2020
1 parent 7de7345 commit 93cdddd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/substituteVariantsAtRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export default function(config, { variantGenerators: pluginVariantGenerators })
}

_.forEach(_.without(ensureIncludesDefault(variants), 'responsive'), variant => {
if (!variantGenerators[variant]) {
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?`);
}
variantGenerators[variant](atRule, config)
})

Expand Down

0 comments on commit 93cdddd

Please sign in to comment.