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

File property is being left out of the resulting rawSourceMap #3

Open
mareksuscak opened this issue Jan 29, 2015 · 0 comments
Open

Comments

@mareksuscak
Copy link

Hey, not sure if this is an issue of the multi-stage-sourcemap package but so far I have traced it, it looks like the issue of this package so here's the thing:

I'm using gulp-stylus v2.0.0 with autoprefixer-stylus 0.5.0 and trying to generate inline source maps using gulp-sourcemaps v1.3.0 on Windows 7 x64, node.js v0.10.36 as follows:

gulp.src('./src/styles/main.styl')
  .pipe(plugins.sourcemaps.init())
  .pipe(plugins.stylus({
    compress: production,
    use: [
      autoprefixer({ browsers: ['last 2 versions'] })
    ]
  }))
  .pipe(plugins.sourcemaps.write())
  .pipe(gulp.dest('./dist/styles/'))

But I'm getting the following error message:

Potentially unhandled rejection [2] Error: Source map to be applied is missing the "file" property
    at assertProperty (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\vinyl-sourcemaps-apply\inde
x.js:32:13)
    at applySourceMap (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\vinyl-sourcemaps-apply\inde
x.js:11:3)
    at D:\Development\youcon-softphone\node_modules\gulp-stylus\index.js:39:13
    at tryCatchReject (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\accord\node_modules\when\li
b\makePromise.js:845:30)
    at runContinuation1 (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\accord\node_modules\when\
lib\makePromise.js:804:4)
    at Fulfilled.when (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\accord\node_modules\when\li
b\makePromise.js:592:4)
    at Pending.run (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\accord\node_modules\when\lib\m
akePromise.js:483:13)
    at Scheduler._drain (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\accord\node_modules\when\
lib\Scheduler.js:62:19)
    at Scheduler.drain (D:\Development\youcon-softphone\node_modules\gulp-stylus\node_modules\accord\node_modules\when\l
ib\Scheduler.js:27:9)
    at process._tickCallback (node.js:442:13)

From what I understand autoprefixer-stylus uses multi-stage-sourcemap and multi-stage-sourcemap causes rawSourceMap to lose "file" property because it's not passed to a Generator object and it seems that the Generator object of source-map package doesn't add this automatically. After reading the readme file of this project it seems that this is an unexpected behaviour because in the example there's a file property.

File property is required by vinyl-sourcemaps-apply package which is a dependency of the gulp-stylus package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants