thanpolas / grunt-closure-tools

Google Closure Tools for grunt
MIT License
95 stars 22 forks source link

closureCompiler task silently fails. #66

Closed ArthurianX closed 9 years ago

ArthurianX commented 10 years ago

I have this task:

`closureCompiler: {

        options: {

            // [REQUIRED] Path to closure compiler
            compilerFile: 'compiler.jar',
            //checkModified: true,

            compilerOpts: {
                compilation_level: 'ADVANCED_OPTIMIZATIONS',
                formatting:'PRETTY_PRINT',
                language_in: 'ECMASCRIPT5_STRICT',
                angular_pass: null,
                create_source_map: null,
                externs: ['externs/angular.js', 'externs/underscore.js'],
                //define: ["'goog.DEBUG=false'"],
                warning_level: 'verbose',
                jscomp_off: ['checkTypes', 'fileoverviewTags', 'missingProperties'],
                summary_detail_level: 3
                //output_wrapper: '"(function(){%output%}).call(this);"'
            },
            execOpts: {
                /**
                 * Set maxBuffer if you got message "Error: maxBuffer exceeded."
                 * Node default: 200*1024
                 */
                maxBuffer: 999999 * 1024
            },
            TieredCompilation: true // will use 'java -server -XX:+TieredCompilation -jar compiler.jar'
        },
        // any name that describes your task
        processJS: {
            src: '<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>-codebase-'+currTimeStamp+'.js',
            dest: '<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>-codebase-'+currTimeStamp+'.js'
        }
    }`

I have ironed out all the errors I was getting and now when I run the task it still fails, like this:

`Executing: java -server -XX:+TieredCompilation -jar "compiler.jar" --js compile/assets/xxx-7.0.0-codebase-1409837668761.js --js_output_file=compile/assets/xxx-7.0.0-codebase-1409837668761.js --compilation_level ADVANCED_OPTIMIZATIONS --formatting PRETTY_PRINT --language_in ECMASCRIPT5_STRICT --angular_pass --create_source_map --externs externs/angular.js --externs externs/underscore.js --warning_level verbose --jscomp_off checkTypes --jscomp_off fileoverviewTags --jscomp_off missingProperties --summary_detail_level 3

Error: Command failed: 0 error(s), 0 warning(s) FAILED to run command for target: processJS Warning: Task "closureCompiler:processJS" failed. Use --force to continue.`

If I force it, everything is ok, but that is not the solution here.

What could I be doing wrong? Or what is the module doing wrong? :D

Thanks!

thanpolas commented 10 years ago

@ArthurianX can you please try to successfully execute the compiler command on command line without using the grunt task? Copy paste it to an editor, try to take it apart (remove parts) until it starts working...

Then we can figure out what's wrong...

ArthurianX commented 10 years ago

Hey Thanasis,

I tried that. 

Directly in the shell I get a message as a response: '0 warnings, 0 errors'.

As a wild guess or going on a limb I'd say that grunt doesn't understand that message as a success, not certain. 

I have the latest closure.jar, I'll try hat you said and then update the issue here. 

thanks !  — Sent from Mailbox

On Thu, Sep 4, 2014 at 6:21 PM, Thanasis Polychronakis notifications@github.com wrote:

@ArthurianX can you please try to successfully execute the compiler command on command line without using the grunt task? Copy paste it to an editor, try to take it apart (remove parts) until it starts working...

Then we can figure out what's wrong...

Reply to this email directly or view it on GitHub: https://github.com/thanpolas/grunt-closure-tools/issues/66#issuecomment-54493597

thanpolas commented 9 years ago

@ArthurianX does this issue persist? Are there any more indications as to the source / cause?

ArthurianX commented 9 years ago

Hello,

I fixed this issue long time ago, but I honestly don't remember what the issue was, apparently the task was silently failing because of some errors in the code, I solved them and it worked, I also added proper externs for the libraries I was using, and it all ended up being ok.

Sorry for not stating the solution here, I was utterly swamped!

On 16 January 2015 at 13:16, Thanasis Polychronakis < notifications@github.com> wrote:

@ArthurianX https://github.com/ArthurianX does this issue persist? Are there any more indications as to the source / cause?

— Reply to this email directly or view it on GitHub https://github.com/thanpolas/grunt-closure-tools/issues/66#issuecomment-70240068 .

Arthur Kovacs - Senior FrontEnd Developer linkedin.com/in/arthurianx

Senior FrontEnd Developer S.C. SHE Informationen Technologies S.R.L. Cladirea mica TCI Invest Str. Alexandru Vaida Voievod, nr. 2-3, parter. Cluj Napoca ROMANIA

Web: http://www.she.net/ http://www.pitechnologies.ro/ Mobile : +4(0721).55.66.00

Yahoo: m3s_4ev3r@yahoo.com Skype: arthur.kovacs85

thanpolas commented 9 years ago

nice, thanks @ArthurianX :)