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

cleancss value.split is not a function breaks #887

Closed
negherbon opened this issue Feb 7, 2017 · 16 comments
Closed

cleancss value.split is not a function breaks #887

negherbon opened this issue Feb 7, 2017 · 16 comments
Labels
Milestone

Comments

@negherbon
Copy link

negherbon commented Feb 7, 2017

Last time i run the build in my company project was 8 days ago and after this are occurring this error bellow:

captura de tela 2017-02-07 as 15 45 28

It's happening this error with someone?

@negherbon
Copy link
Author

negherbon commented Feb 7, 2017

My mistake sorry.

@jakubpawlowicz
Copy link
Collaborator

No worries!

@ernestoalejo
Copy link

What was the mistake here? I have this error too with this input:

@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Rasa');

@Manu1400
Copy link

Please, reopen this issue.

@jakubpawlowicz jakubpawlowicz reopened this Jun 3, 2017
@jakubpawlowicz
Copy link
Collaborator

@ernestoalejo @Manu1400 @negherbon any further details here?

@ernestoalejo
Copy link

Sorry, I don't remember the details of this error. I have checked the commits of that day and there's one updating from gulp-clean-css ^2.0.12 to ^3.0.2; but I can't reproduce the issue even when forcing the version 3.4.12 of this package.

@jakubpawlowicz
Copy link
Collaborator

Thanks @ernestoalejo for giving it a try - @Manu1400?

@jakubpawlowicz
Copy link
Collaborator

Ping!

@ivanreese
Copy link

I'm getting this error too, using the latest gulp-clean-css, which is currently using clean-css 4.1.5.

Here's how I'm invoking clean-css — I hope you can read coffeescript!

.pipe gulp_clean_css
  level:
    1:
      removeEmpty: false

If I set removeEmpty: true, that fixes the error. I can mix in all other sorts of other optimization configurations (eg: O2 on and off, various other O1 options on or off), and that doesn't seem to affect the issue.

Here's my stack trace.

The input CSS file doesn't seem to matter. I've tested it with a bunch of different kinds of input, including a completely empty file. All of them break in the same way, as best as I can tell.

Let me know if there's anything else I can do to help repro.

jakubpawlowicz added a commit that referenced this issue Jul 8, 2017
Why:

* When `removeEmpty: false` is used then comments are not properly
  removed from a list of tokens.
@jakubpawlowicz
Copy link
Collaborator

I've found an edge case in serializing code and will push it with 4.1.6. Hopefully it solves the problem.

@jakubpawlowicz jakubpawlowicz added this to the 4.1.6 milestone Jul 8, 2017
@jakubpawlowicz
Copy link
Collaborator

Fixed in 4.1.6.

@michaeldemille
Copy link

Hi, I'm getting a similar issue when I try to build my angular project. It's a fairly large project, and I'm not sure what exactly I'm looking for that could be breaking the build. If you could give me any direction as to what could possibly cause this issue in my .scss code, that would be greatly appreciated.

Thanks,

Screen Shot 2019-09-26 at 7 05 06 AM

@michaeldemille
Copy link

A little bit more information about the above project. It is an ionic 4 angular 8 project. The above error occurs when I run the ng build --prod script. I thought it might be something syntax related from recent code commits to the .scss files, so I ran js-beautify on the .scss files to clean them up, and it's still having the same error.

@michaeldemille
Copy link

michaeldemille commented Sep 26, 2019

Here are the default settings that the cleancss-webpack-plugin.js file is using from the angular setup.

const cleancss = new CleanCSS({
compatibility: 'ie9',
level: {
2: {
skipProperties: [
'transition',
'font',
]
}
},
inline: false,
returnPromise: true,
sourceMap: this._options.sourceMap,
});

@michaeldemille
Copy link

if I change the removeEmpty option to false, then the error turns into this:

image

@michaeldemille
Copy link

I found the problem. It ended up being caused by a missing semi-colon in my scss:

image

which caused value to be an array instead of a string.

image

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

No branches or pull requests

6 participants