systemjs / plugin-css

CSS loader plugin
MIT License
92 stars 60 forks source link

Invalid css passes through #117

Open arackaf opened 7 years ago

arackaf commented 7 years ago

It looks like a prior version of this plugin caused invalid content, like

<<<<<<< HEAD

to error silently, swallowing the error, causing the Node process to hang indefinitely. It looks like the current version just passes the invalid content through.

Not knowing much about the specifics here, but it seems like the earlier version would be more correct, except ideally throwing the error up, forcing the parent process to handle.

guybedford commented 7 years ago

@arackaf the issue as far as I can tell is that PostCSS is parsing the above without errors causing it to appear fine. In my tests:

>>>>> X

body {
  padding: 10px;
}

Seems to work fine as >>>>> X parses and minifies.

But for example:

>>>>> X {
  asdf
}

body {
  padding: 10px;
}

Seems to cause a deeper error which stops the inlining entirely.

The second error here is the one that worries me because that causes a deeper failure, without any hint to the user as to how to debug it.

We know the value of compilers lies in early warnings. It seems like a missed trick entirely for PostCSS if this is not the case!