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

less task hangs silently with sourceMap: true when EPERM expected #271

Open
DimitarChristoff opened this issue Apr 27, 2015 · 1 comment

Comments

@DimitarChristoff
Copy link

Interesting issue. Using a perforce repo, the files need to be unlocked before building. sometimes you forget and the task throws an EPERM error:

Writing web/assets/style.min.css...ERROR
Fatal error: Unable to write "web/assets/style.min.css" file (Error code: EPERM).�

that's caught and the task exits, as expected.

When sourceMap: true is set, relating to https://github.com/gruntjs/grunt-contrib-less/blob/master/tasks/less.js#L71 and grunt.file.write(), it just hangs.

With --verbose, it catches it:

Writing web/assets/style.min.css.map...ERROR

BUT: it does not exit the process and just hangs. This also affects watch tasks etc.

@DimitarChristoff
Copy link
Author

this should probably be caught by the grunt/file.js grunt.file - https://github.com/gruntjs/grunt/blob/master/lib/grunt/file.js#L300 but it's just not working.

adding this fixes it:

              try {
                grunt.file.write(sourceMapFilename, output.map);
                grunt.log.writeln('File ' + chalk.cyan(options.sourceMapFilename) + ' created.');
              }
              catch(err){
                nextFileObj(err);
              }
Writing web/assets/style.min.css.map...ERROR
Writing web/assets/style.min.css...ERROR
Fatal error: Unable to write "web/assets/style.min.css" file (Error code: EPERM).�

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

1 participant