less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Source map bug introduced in 2.7.0, but passes tests

Open matthew-dean opened this issue 10 years ago • 19 comments

Will put out a hotfix soon if the fix can be confirmed. It looks like PR #2834 introduced a bug that produces a blank source map, and throws an error like:

Invalid mapping: {"generated":{"line":1103,"column":2},"source":"file.less","original":{"line":1,"column":null},"name":null}

(Also discussed at #2881.)

Reverting #2834 seems to fix it, but looking for confirmation.

matthew-dean avatar May 08 '16 02:05 matthew-dean

This issue should stay open until a Less.js test is added which catches this issue, since the source map tests didn't detect the bug.

matthew-dean avatar May 08 '16 02:05 matthew-dean

I'm experiencing the same issue. I executed a git bisect and the first commit that broke the build was 470af20f641c9b5389475733dfe341aa4c180fba which is in the PR you noted in your issue

wolfy1339 avatar May 08 '16 15:05 wolfy1339

better unpublish this version

sunnylqm avatar May 09 '16 01:05 sunnylqm

better unpublish this version

It depends. For some the sourcemaps are totally insignificant if compared to for example https://github.com/less/less.js/issues/2841 of the previous release.

seven-phases-max avatar May 09 '16 02:05 seven-phases-max

In case it can help, I could reproduce the issue with something like:

Less:

.dl-horizontal {
    @media (min-width: 768px) {
        dt {
            float: left;
        }
    }
}

Gulp task:

return gulp.src('./src/lib.less')
    .pipe(sourcemaps.init())
    .pipe(less())
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(bundleFolder));

antoineol avatar May 09 '16 09:05 antoineol

This just broke my builds, need a patch asap...

felixfbecker avatar May 09 '16 10:05 felixfbecker

Please fix this bug asap, or I can only froze the version to 2.6.X. And I wish this bug could be fixed before tomorrow morning. Appreciate it very much.

icecreamliker avatar May 09 '16 12:05 icecreamliker

Production chaos on this side as well...

olivierlesnicki avatar May 09 '16 14:05 olivierlesnicki

Crashes my gulp build as well

BramVanBerkel avatar May 09 '16 14:05 BramVanBerkel

If you're having trouble with a dependency using less as a dependency and simply can't downgrade in package.json. Do a npm shrinkwrap --dev and then modify the version of less to 2.6.1 then full npm reinstall will fix it until less.js is fixed

oBusk avatar May 09 '16 15:05 oBusk

Clearly the impact is widespread. It blocked my production release. Yes, please implement a hotfix, and provide workarounds, but in the meantime, for the love of all that is good and holy:

$ npm unpublish [email protected]

Unless you will have 2.7.1 published within, say, the next hour, nip this in the bud and unpublish.

gilly3 avatar May 09 '16 18:05 gilly3

Any line of sight for a fix on this yet?

ReidBraswell avatar May 09 '16 19:05 ReidBraswell

I've published 2.7.1 as a hotfix for 2.7.0, but it's unclear from #2881 if there isn't still an outstanding bug affecting source maps (multiple intersecting bugs from same commit?), or if that was a pre-existing bug which was introduced separately.

Please report back if 2.7.1 is working for you.

matthew-dean avatar May 09 '16 20:05 matthew-dean

works for me, thanks @matthew-dean

felixfbecker avatar May 09 '16 21:05 felixfbecker

the bootprint-integration-test had failed with [email protected] and it succeeds with 2.7.1. Works for me. Thanks @matthew-dean

nknapp avatar May 09 '16 21:05 nknapp

Awesome. Sorry for the broken build everyone, but glad it's working now. Will close this.

matthew-dean avatar May 09 '16 21:05 matthew-dean

@matthew-dean good job

olivierlesnicki avatar May 09 '16 21:05 olivierlesnicki

@olivierlesnicki 👍

matthew-dean avatar May 09 '16 22:05 matthew-dean

Hi, If my project have been compile all less file to css file already with chrun2 program. I'm not use less.js. Could you tell me how to do about debug css show less in get element inspector develope. How to config sauce map?

Piyamas2507 avatar May 27 '16 09:05 Piyamas2507