through2: v2.0.4 breaking change for gulp packages when using Node 0.10

The release of v2.0.4 contained a breaking change for Node v0.10 & npm v1.4.28 (please don’t laugh)

This has caused gulp-utils to fail due to using "through2": "^2.0.0" where it pulls in v2.0.4, where v2.03 built correct.

Gulp-utils installs fine, but then fails to run with the following error:

-----> Running run_gulp_build
12:18:47
/tmp/build_ba31c9b023b8ec485371690aba70d833/.heroku/python/lib/node_modules/gulp/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream/errors.js:3
const codes = {};
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/tmp/build_ba31c9b023b8ec485371690aba70d833/.heroku/python/lib/node_modules/gulp/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream/lib/internal/streams/state.js:3:29)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

We’re currently working on figuring out the exact cause of this issue.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (2 by maintainers)

Commits related to this issue

Most upvoted comments

OK, this is done now. 2.0.5 has a rollback(ish):

diff --git a/package.json b/package.json
index 123bc4a..15960b6 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,10 @@
 {
   "name": "through2",
-  "version": "3.0.0",
-  "description": "A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise",
+  "version": "2.0.5",
+  "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
   "main": "through2.js",
   "scripts": {
-    "test": "nyc node test/test.js | faucet && nyc report"
+    "test": "node test/test.js | faucet"
   },
   "repository": {
     "type": "git",
@@ -19,13 +19,14 @@
   "author": "Rod Vagg <r@va.gg> (https://github.com/rvagg)",
   "license": "MIT",
   "dependencies": {
-    "readable-stream": "2 || 3",
+    "readable-stream": "~2.3.6",
     "xtend": "~4.0.1"
   },
   "devDependencies": {
     "bl": "~2.0.1",
     "faucet": "0.0.1",
     "nyc": "~13.1.0",
+    "safe-buffer": "~5.1.2",
     "stream-spigot": "~3.0.6",
     "tape": "~4.9.1"
   }
diff --git a/test/test.js b/test/test.js
index 1e9573d..474f090 100644
--- a/test/test.js
+++ b/test/test.js
@@ -3,6 +3,7 @@ const test     = require('tape')
     , crypto   = require('crypto')
     , bl       = require('bl')
     , spigot   = require('stream-spigot')
+    , Buffer   = require('safe-buffer').Buffer
 
 test('plain through', function (t) {
   var th2 = through2(function (chunk, enc, callback) {

So 2.0.5 is pinned to readable-stream@2. I also have a v2.x branch to maintain this as needed.

3.0.0 has the new stuff but still does 2||3, so you could still do the pinning yourself as per my comment above.

thanks @rvagg!!

Yeah, I think a rollback and major is necessary

I’d love to interview anyone who’s still using node 0.10. Mostly out of fascinated horror but also to learn more about what keeps projects using old versions.