Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting for CSS syntax errors #7

Open
mariocasciaro opened this issue Apr 22, 2014 · 1 comment
Open

Improve error reporting for CSS syntax errors #7

mariocasciaro opened this issue Apr 22, 2014 · 1 comment

Comments

@mariocasciaro
Copy link
Owner

No description provided.

@vitorbaptista
Copy link

Might be related to this issue. If a CSS has an invalid import, like:

/* missing semicolon */
@import "foo"
@import "bar"

gulp-concat-css will throw a quite cryptic error. The issue is in:

// https://github.com/mariocasciaro/gulp-concat-css/blob/master/index.js#L61-L62
var importData = parseImport('@import ' + rule.import + ';');
var importPath = importData && importData[0].path;

parseImport returns an empty array when it couldn't find any imports, so although importData is truthy, import[0] is undefined, and the code blows up. This seems like a good place to add a check if importData[0] exists and, if not, throw a friendlier error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants