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

Minify Directory on CSS goes on error: Minify Failed #41

Open
entoz opened this issue Apr 12, 2019 · 7 comments
Open

Minify Directory on CSS goes on error: Minify Failed #41

entoz opened this issue Apr 12, 2019 · 7 comments

Comments

@entoz
Copy link

entoz commented Apr 12, 2019

Hello,

I have an issue on a minifying directory with CSS files on Windows 10 with VSCode 1.33.1.

It goes on error: "Minify failed: 2 error(s).

It works on JS and single CSS files.

@millipedia
Copy link

millipedia commented Apr 15, 2019

I also have this problem on macOS 10.14.4 with VSCode 1.33.1.

Trying to minify a directory with even a single css file in will result in a failure with "Minify failed: 1 error(s)". The number of errors is just the number of css files in the directory.

Directories that previously worked fine no longer minify. This possibly happened after upgrading to 10.14.4 but I'm not 100% sure.

If I dump the error to console at about line 178 of extension.js I get:

"Ignoring local @import of "css/test.css" as resource is missing."

however .... if I just comment out the line at 168 of extension.js that is removing the absolute file path:

// files = files.map(f => f.replace(settings.css.root, ""));

then everything works fine. The directory is minified with no errors.

No idea why we need to keep the absolute path now but hope that's some help. Let me know if I can provide any more info.

s.

@moosereeve
Copy link

Same on Windows 10 VSCode 1.33.1. Commenting out line 168 worked for me as well

@SebSob
Copy link

SebSob commented May 9, 2019

@millipedia @reevet - How do you modify the source code extension.js ?
Where is this file located?

EDIT: For windows it's in: C:\Users\<user>\.vscode\extensions\hookyqr.minify-0.4.3

@LiteSoul
Copy link

LiteSoul commented Jul 3, 2019

I'm having the same error, and commenting out that line solved it.
Although we need a permanent solution

@entoz
Copy link
Author

entoz commented Jul 4, 2019

Commenting out that line solves the problem, but there is another issue. In the minified file paths would be incorrect.

for example

If you have CSS like this:
background-image: url(../images/bill.png);

In output file would be like this:
background-image:url(d:/Projects/test/styles/images/bill.png);

So, then you must replace in the outputted file all "d:/Projects/test/styles" with "..".

@Ricoder92
Copy link

Commenting out that line solves the problem, but there is another issue. In the minified file paths would be incorrect.

for example

If you have CSS like this:
background-image: url(../images/bill.png);

In output file would be like this:
background-image:url(d:/Projects/test/styles/images/bill.png);

So, then you must replace in the outputted file all "d:/Projects/test/styles" with "..".

Just set the setting "rebase" to false. Thats should fix that.

@LupeBe
Copy link

LupeBe commented Dec 29, 2020

A little bit late, but anyhow ...
Replacing the deprecated "rootPath" property (extension.js, lines 96 and 166) with "workspaceFolder" fixed it for me.

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

No branches or pull requests

7 participants