Closed jeroenvisser101 closed 8 years ago
There was a long story of autoprefixer mutations - package name & signature change. Probably, feature loss happened at some point. It worth to check that atoprefixer map output is in string format, not an object https://github.com/nodeca/mincer/blob/master/lib/mincer/processors/autoprefixer.js#L88.
@puzrin thanks! I'll check that out now, and if that's it, create a PR
https://github.com/nodeca/mincer/blob/master/lib/mincer/compressors/csswring_compressor.js#L72
Probably csswring can have the same problem, because it uses exactly the same engine.
So typeof this.map == 'string'
should evaluate to true, correct?
It seems to be csswring indeed, console.log'ing it's this.map
gives an instance of SourceMapGenerator:
SourceMapGenerator {
_file: 'application.css',
_sourceRoot: null,
_skipValidation: false,
_sources:
ArraySet {
_array:
[ 'application.css',
...
'styleguide/typography.scss' ],
_set:
{ '$application.css': 0,
...
'$styleguide/typography.scss': 218 } },
_names: ArraySet { _array: [], _set: {} },
_mappings:
MappingList {
_array:
[ [Object],
...
[Object],
https://github.com/mozilla/source-map#sourcemapgeneratorprototypetostring i guess .toString()
should help.
@puzrin got it! It was autoprefixer after all, committing now and submitting for review!
I've tried to debug this issue a few times already, but never had enough time, but since this issue is getting an issue more and more, I'd like to ask for help here.
For some reason, if I have my configuration with:
...there are a few assets (note: these assets are plain CSS, no SASS) fail within the
Context.prototype.createSourceMapObject
function. It seems that these files passobj.map
as an object, not as a string, and when that happens, JSON.parse fails.I'm not sure why
obj.map
is a object here, since this function doesn't expect that at all. I tried to patch this, by catching the JSON parse error, and just passingobj.map
asmap
directly, and that works.That is again just a workaround, but I wasn't able to dig any further.
(I also have some backtraces, which I don't think are of many help, but attaching them anyways)
And package.json dependencies: