Open chancegraff opened 8 years ago
can this be merged pls?
I have the same issue with the sass compiler (either node-sass
or dart-sass
) - works perfectly on the regular shell but not with django-pipeline. Any idea what I am doing wrong? I added the PRs code but I always get WinError 193 - not valid Win32 application
.
I've spent the last couple of days troubleshooting my pipeline setup in an attempt to get compression to work correctly without success. I was originally receiving a "file not found" error whenever attempting to collectstatic in my Django project, which was happening because the pipeline needed to be pointed to the Yuglify file with the YUGLIFY_BINARY setting.
After setting that, I began receiving the error "OSError: [WinError 193] %1 is not a valid Win32 application" during the compression step. The traceback showed that the error was happening just before the subprocess.py file was hit, in the pipeline\compressors\yuglify.py file:
I eventually found a question on StackOverflow in which the author had modified their compressor file with the following code (which I also added to my YuglifyCompressor class):
Now upon running the collectstatic command, I was greeted with a beautiful success message, but ultimately the compressed files were only filled with the text "None", so I haven't exactly figured this out just quite yet.
In the log, the above print commands did come through with some answers about what was being called and subsequently throwing the OSError:
Previously I had checked to make sure that my file type associations were set correctly to rule out the possibility that Windows was simply failing to recognize what .exe file needed to be executed for the .py files. Sadly everything looked normal:
Any help would be appreciated.
Edit: I've narrowed it down a little further and found that it's only throwing this error whenever attempting to compress CSS files:
As you can see the exception being caught now has changed, so I've updated the title of this issue to reflect that. This change happened because I changed the YUGLIFY_BINARY setting to point to the .cmd file instead of its JavaScript sibling. I also realized I hadn't posted my PIPELINE settings:
Edit 2: Alright, I've managed to get my JavaScript files running into the compressor at least, but it's failing inside. Here's the stacktrace:
Compression error: b'\r\nC:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\bin\\yuglify:77\r\n throw(err);\r\n ^\r\nError\r\n at new JS_Parse_Error (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:263:18)\r\n at js_error (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:271:11)\r\n at croak (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:733:9)\r\n at token_error (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:740:9)\r\n at unexpected (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:746:9)\r\n at C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:1124:9\r\n at maybe_unary (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:1209:19)\r\n at expr_ops (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:1236:24)\r\n at maybe_conditional (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:1240:20)\r\n at maybe_assign (C:\\Users\\cgraf\\AppData\\Roaming\\npm\\node_modules\\yuglify\\node_modules\\uglify-js\\lib\\parse-js.js:1264:20)\r\n' // arguments: ['C:\\Users\\cgraf\\AppData\\Roaming\\npm\\yuglify.cmd', '--type=js', '--terminal']