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

Sourcemaps + no output = failing less parser #146

Closed
johngeorgewright opened this issue Feb 16, 2015 · 1 comment
Closed

Sourcemaps + no output = failing less parser #146

johngeorgewright opened this issue Feb 16, 2015 · 1 comment

Comments

@johngeorgewright
Copy link

I'm unsure where this problem stems from, but if I have a LESS file that doesn't result in any CSS output, then try compiling it using this gulp plugin, with sourcemaps, the LESS parser starts complaining about unexpected output u. E.g:

// gulp task
gulp.task('css:dev', function () {
  return gulp
    .src(SOURCE_FILES)
    .pipe(sourcemaps.init())
    .pipe(less())
    .on('error', console.error)
    .pipe(concat('main.css'))
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(BUILD_DIR));
});
some-tag {
  // This will result in an empty output file
}
 $ gulp css:dev
[09:37:35] Using gulpfile gulpfile.js
[09:37:35] Starting 'css:dev'...

node_modules/gulp-less/node_modules/less/lib/less/parser/parser.js:183
                    return callback(null, root);
                           ^
SyntaxError: Unexpected token u
    at Object.parse (native)
    at node_modules/gulp-less/node_modules/accord/lib/adapters/less.js:48:32
    at node_modules/gulp-less/node_modules/less/lib/less/parse.js:63:17
    at Object.finish [as _finish] (node_modules/gulp-less/node_modules/less/lib/less/parser/parser.js:183:28)
    at Object.ImportVisitor._onSequencerEmpty (/node_modules/gulp-less/node_modules/less/lib/less/visitors/import-visitor.js:35:14)
    at ImportSequencer.tryRun (node_modules/gulp-less/node_modules/less/lib/less/visitors/import-sequencer.js:50:14)
    at Object.ImportVisitor.run (node_modules/gulp-less/node_modules/less/lib/less/visitors/import-visitor.js:29:25)
    at Object.Parser.parse (node_modules/gulp-less/node_modules/less/lib/less/parser/parser.js:189:22)
    at Object.parse (node_modules/gulp-less/node_modules/less/lib/less/parse.js:61:18)

Every will start working when taking away the sourcemap integration.

@yocontra
Copy link
Member

Duplicate of #122

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

2 participants