OverZealous / run-sequence

Run a series of dependent gulp tasks in order
MIT License
961 stars 56 forks source link

Creates a RangeError: Array buffer allocation failed when used with cdnizer #83

Closed computersarecool closed 7 years ago

computersarecool commented 7 years ago

cdnizer is awesome, so is run-sequence.

However, when I use them together I run into an issue. Currently my sequence looks like this:

gulp.task('prep', callback => {
   runSequence('clean:dist', 'standard', 'wiredepDist', 'babel', 'ngAnnotate', 'stylus', 'useref', 'cdnizer', callback)
}) 

When I run gulp prep I get:

[20:19:38] 'cdnizer' errored after 25 ms
|[20:19:38] RangeError: Array buffer allocation failed
|    at Buffer.Uint8Array (native)
|    at FastBuffer (buffer.js:11:5)
|    at createUnsafeBuffer (buffer.js:38:12)
|    at allocate (buffer.js:181:12)
|    at Function.Buffer.allocUnsafe (buffer.js:141:10)
|    at tryCreateBuffer (fs.js:474:21)
|    at Object.fs.readFileSync (fs.js:519:14)
|    at Object.Module._extensions..json (module.js:585:20)
|    at Module.load (module.js:487:32)
|    at tryModuleLoad (module.js:446:12)
|[20:19:38] 'prep' errored after 4.3 s
|[20:19:38] RangeError in plugin 'run-sequence(cdnizer)'
|Message:
|    Array buffer allocation failed
|Stack:

But when I run gulp cdnizer alone, I do not have this issue. Is this something I am doing wrong on my end?

OverZealous commented 7 years ago

I've never seen that before. What's the code for the cdnizer step look like? What version of Node & Gulp are you running?

OverZealous commented 7 years ago

Generally speaking, almost all errors with run-sequence are due to misconfigured tasks—specifically, ones that don't handle async correctly. If any step along the way doesn't return a stream, promise, or use a callback, then it's possible your cdnizer task is running before another step completes.

computersarecool commented 7 years ago

I am sure that is it. I will investigate my tasks closer and report back.

OverZealous commented 7 years ago

@computersarecool Did you ever find out any more about this?

computersarecool commented 7 years ago

It was due, as you thought, to a misconfigured task. Thank you.