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

gulp-less minor dependency on less introduce : Source map bug introduced in less 2.7.0 #237

Closed
mlardy opened this issue May 9, 2016 · 9 comments · Fixed by #238
Closed

Comments

@mlardy
Copy link

mlardy commented May 9, 2016

Hi

I'm stucked with a less bug :
_ Error in plugin 'gulp-less'
Message:
Invalid mapping: {"generated":{"line":190,"column":2},"source":".../bootstrap/less/print.less","original":{"line":1,"column":null},"name":null} in file undefined line no. undefined
Details:
lineNumber: undefined
fileName: undefined_

I think that you should not reference minor version changes in your package.json for less dependency.

If there are some bugs in dependencies like this one less/less.js#2896 we can't use a previous minor version of gulp-less with a previous less minor version.

You should probably release a gulp-less 3.1.x to point to a less ~2.6.x and upgrade minor of gulp-less when a less minor is released.

@leighgordy
Copy link

I'm having the same issue. Your plugin is pulling the latest less 2.7.0 which is currently broken. Changing your project so that it references 2.6.1 will bypass the issue.

@leighgordy
Copy link

Commenting out reference to gulp-source maps in the gulp script is the quickest way to bypass the 2.7.0 issue. e.g. pipe(sourcemaps.init()) pipe(sourcemaps.write('./')).

@felixfbecker
Copy link

felixfbecker commented May 9, 2016

The best way would be if gulp-less had the option to pass a custom reference to the less module, like gulp-typescript allows it. That way we could all easily revert to less@2.6
Example:

const gulpLess = require('gulp-less')
const less = require('less')

gulp.src('app.less')
  .pipe(gulpLess({less, paths: [__dirname + '/node_modules']}))
  .pipe(gulp.dest('build'))

@oBusk
Copy link

oBusk commented May 9, 2016

We would really like to be able to pass less as an option to have better control over which version to use.

const gulpLess = require('gulp-less');
const less = require('less');

gulp.src('app.less')
    .pipe(gulpLess({
        less: less
    });
    .pipe(gulp.dest('build'));

Similiar to how gulp-typescript does it.

However i guess it would be more correct and work even smoother if less was added as a peer dependency?


For anyone having this problem now do a npm install, npm shrinkwrap --dev and then modify the shrinkwrap version of "less" to be 2.6.1.

...
"less": {
          "version": "2.6.1",
          "from": "less@>=2.6.1 <2.7.0",
          "resolved": "https://registry.npmjs.org/less/-/less-2.6.1.tgz",
          "dependencies": {
...

Then do a clean install

@davetheflashguy
Copy link

Ran into this today, I too ended up doing what @leighgordy suggested.

@lucknerjb
Copy link

^ Ditto! Thanks @oBusk

@oBusk
Copy link

oBusk commented May 9, 2016

This should have been fixed with a 2.7.1 version of less. Doing an npm install/update should fix this problem. gulp-less would still benefit greatly from an ability to use a specific version of less.

@johnkors
Copy link

Related?

[15:42:00][Step 6/6] [15:42:00] Starting 'boostrapLess'...
[15:42:00][Step 6/6] [15:42:00] Starting 'less'...
[15:42:01][Step 6/6] [15:42:01] Invalid mapping: {"generated":{"line":1289,"column":2},"source":"Content/Styles/Libs/Bootstrap-3.3.6/type.less","original":{"line":1,"column":null},"name":null} in file undefined line no. undefined
[15:42:01][Step 6/6] [15:42:01] Finished 'boostrapLess' after 1.56 s
[15:42:02][Step 6/6] [15:42:02] Finished 'less' after 2.04 s

@davetheflashguy
Copy link

Yup @johnkors , I had the same issues yesterday with boostrap

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

Successfully merging a pull request may close this issue.

7 participants