north / generator-style-prototype

Yeoman Generator for Style Prototypes
362 stars 49 forks source link

stream.js Unhandled stream error in pipe, SyntaxError unexpected end of input #59

Closed fallenturtle closed 10 years ago

fallenturtle commented 10 years ago

I wish I could say what to do to reproduce this error, but I haven't figured out what's causing it. Its happened to me twice now. Yesterday I couldn't figure out how to resolve it and since I was early enough in my project I just gave up and started a new project.

At this point I'm pretty deep into the project and it happened again. Gulp stops responding and when I kill it and then type gulp again I get this:

[gulp] [15:11:17] Using gulpfile ~/Sites/cfsr14/Gulpfile.js
[gulp] [15:11:17] Starting 'watch'...
[gulp] [15:11:17] Finished 'watch' after 23 ms
[gulp] [15:11:17] Starting 'sections'...
[gulp] [15:11:17] Finished 'sections' after 5.07 ms
[gulp] [15:11:17] Starting 'bower-copy-components'...
[gulp] [15:11:17] Finished 'bower-copy-components' after 3.96 ms
[gulp] [15:11:17] Starting 'bcc'...
[gulp] [15:11:17] Finished 'bcc' after 6.67 μs
[gulp] [15:11:17] Starting 'components'...
[gulp] [15:11:17] Finished 'components' after 22 ms
[gulp] [15:11:17] Starting 'data'...
[gulp] [15:11:17] Finished 'data' after 1.3 ms
[gulp] [15:11:17] Starting 'compass'...
[gulp] [15:11:17] Starting 'browserSync'...
[gulp] [15:11:17] Finished 'browserSync' after 3.22 ms
[15:11:17] Converted /Users/abailey/Sites/cfsr14/sections.yml to /Users/abailey/Sites/cfsr14/sections.json
[15:11:17] Converted /Users/abailey/Sites/cfsr14/style-tile.yml to /Users/abailey/Sites/cfsr14/style-tile.json
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has replaced the plugins
[15:11:17] 埽 The Maid has updated the files
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has replaced the plugins
[15:11:17] 埽 The Maid has updated the files
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has replaced the plugins
[15:11:17] 埽 The Maid has updated the files
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has replaced the plugins
[15:11:17] 埽 The Maid has updated the files
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has replaced the plugins
[15:11:17] 埽 The Maid has updated the files
[15:11:17] Converted /Users/abailey/Sites/cfsr14/components.yml to /Users/abailey/Sites/cfsr14/components.json
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has updated the files
[15:11:17] 埽 The Maid has cleaned
[15:11:17] 埽 The Maid has updated the files
[15:11:17] Converted /Users/abailey/Sites/cfsr14/layouts.yml to /Users/abailey/Sites/cfsr14/layouts.json

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
SyntaxError: Unexpected end of input
    at Object.parse (native)
    at Object.me.readFileSync (/Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/node_modules/jsonfile/lib/jsonfile.js:28:15)
    at /Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/helpers/menu.js:10:35
    at wrappedMapper (/Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/node_modules/event-stream/node_modules/map-stream/index.js:84:19)
    at Stream.stream.write (/Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/node_modules/event-stream/node_modules/map-stream/index.js:96:21)
    at write (_stream_readable.js:583:24)
    at flow (_stream_readable.js:592:7)
    at Duplex.pipeOnReadable (_stream_readable.js:624:5)
    at Duplex.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)

It doesn't always happen right after converting layouts.yml. Sometimes it will be after the "the Maid has updated the files".

I'm not sure if this is useful or not, but if I type bower list it outputs:

bower check-new     Checking for new versions of the project dependencies..
cfsr14--style-prototype#0.0.0 /Users/abailey/Sites/cfsr14
├── borealis#1.0.1
├─┬ eq.js#1.4.1
│ └── domready#1.0.5
├── north#0.4.0
└─┬ style-prototype#2.0.0-alpha.19
  ├── angular#1.2.19 (1.2.20-build.289+sha.bf55f23 available, latest is 1.3.0-build.2898+sha.36831ec)
  ├── angular-local-storage#0.0.5
  ├─┬ angular-route#1.2.19 (1.2.20-build.289+sha.bf55f23 available, latest is 1.3.0-build.2898+sha.36831ec)
  │ └── angular#1.2.19 (latest is 1.3.0-build.2898+sha.36831ec)
  └── prism#cbe9b04246

I tried updating generator-style-prototype, but it didn't help. Would updating those dependencies that say they have new versions help?

FWIW, here are some other versions that I'm running: Mac OS 10.9.3 Bower 1.3.7 gulp CLI: 3.7.0, Local: 3.8.5 Yeoman 1.2.0 Ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13] npm 1.4.3 Sass 3.3.8 Compass 0.12.6

Some things I think have been upgraded, but I think I mostly using the same setup I set up in Advanced Sass/Compass training at Drupal 2014 in Austin (a great training, btw. thanks!)

Snugug commented 10 years ago

I’ve run into this a few times myself and still haven’t quite tracked down what’s causing it (and why it seems to happen unexpectedly). Try the following:

rm -r .www .tmp gulp refresh gulp

On Tuesday, July 8, 2014 at 6:32 PM, Andrew Bailey wrote:

I wish I could say what to do to reproduce this error, but I haven't figured out what's causing it. Its happened to me twice now. Yesterday I couldn't figure out how to resolve it and since I was early enough in my project I just gave up and started a new project. At this point I'm pretty deep into the project and it happened again. Gulp stops responding and when I kill it and then type gulp again I get this: [gulp] [15:11:17] Using gulpfile ~/Sites/cfsr14/Gulpfile.js [gulp] [15:11:17] Starting 'watch'... [gulp] [15:11:17] Finished 'watch' after 23 ms [gulp] [15:11:17] Starting 'sections'... [gulp] [15:11:17] Finished 'sections' after 5.07 ms [gulp] [15:11:17] Starting 'bower-copy-components'... [gulp] [15:11:17] Finished 'bower-copy-components' after 3.96 ms [gulp] [15:11:17] Starting 'bcc'... [gulp] [15:11:17] Finished 'bcc' after 6.67 μs [gulp] [15:11:17] Starting 'components'... [gulp] [15:11:17] Finished 'components' after 22 ms [gulp] [15:11:17] Starting 'data'... [gulp] [15:11:17] Finished 'data' after 1.3 ms [gulp] [15:11:17] Starting 'compass'... [gulp] [15:11:17] Starting 'browserSync'... [gulp] [15:11:17] Finished 'browserSync' after 3.22 ms [15:11:17] Converted /Users/abailey/Sites/cfsr14/sections.yml to /Users/abailey/Sites/cfsr14/sections.json [15:11:17] Converted /Users/abailey/Sites/cfsr14/style-tile.yml to /Users/abailey/Sites/cfsr14/style-tile.json [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has replaced the plugins [15:11:17] 埽 The Maid has updated the files [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has replaced the plugins [15:11:17] 埽 The Maid has updated the files [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has replaced the plugins [15:11:17] 埽 The Maid has updated the files [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has replaced the plugins [15:11:17] 埽 The Maid has updated the files [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has replaced the plugins [15:11:17] 埽 The Maid has updated the files [15:11:17] Converted /Users/abailey/Sites/cfsr14/components.yml to /Users/abailey/Sites/cfsr14/components.json [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has updated the files [15:11:17] 埽 The Maid has cleaned [15:11:17] 埽 The Maid has updated the files [15:11:17] Converted /Users/abailey/Sites/cfsr14/layouts.yml to /Users/abailey/Sites/cfsr14/layouts.json stream.js:94 throw er; // Unhandled stream error in pipe. ^ SyntaxError: Unexpected end of input at Object.parse (native) at Object.me.readFileSync (/Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/node_modules/jsonfile/lib/jsonfile.js:28:15) at /Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/helpers/menu.js:10:35 at wrappedMapper (/Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/node_modules/event-stream/node_modules/map-stream/index.js:84:19) at Stream.stream.write (/Users/abailey/Sites/cfsr14/node_modules/gulp-style-prototype/node_modules/event-stream/node_modules/map-stream/index.js:96:21) at write (_stream_readable.js:583:24) at flow (_stream_readable.js:592:7) at Duplex.pipeOnReadable (_streamreadable.js:624:5) at Duplex.EventEmitter.emit (events.js:92:17) at emitReadable (_stream_readable.js:408:10)

It doesn't always happen right after converting layouts.yml. Sometimes it will be after the "the Maid has updated the files". I'm not sure if this is useful or not, but if I type bower list it outputs: bower check-new Checking for new versions of the project dependencies.. cfsr14--style-prototype#0.0.0 /Users/abailey/Sites/cfsr14 ├── borealis#1.0.1 ├─┬ eq.js#1.4.1 │ └── domready#1.0.5 ├── north#0.4.0 └─┬ style-prototype#2.0.0-alpha.19 ├── angular#1.2.19 (1.2.20-build.289+sha.bf55f23 available, latest is 1.3.0-build.2898+sha.36831ec) ├── angular-local-storage#0.0.5 ├─┬ angular-route#1.2.19 (1.2.20-build.289+sha.bf55f23 available, latest is 1.3.0-build.2898+sha.36831ec) │ └── angular#1.2.19 (latest is 1.3.0-build.2898+sha.36831ec) └── prism#cbe9b04246

I tried updating generator-style-prototype, but it didn't help. Would updating those dependencies that say they have new versions help? FWIW, here are some other versions that I'm running: Mac OS 10.9.3 Bower 1.3.7 gulp CLI: 3.7.0, Local: 3.8.5 Yeoman 1.2.0 Ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13] npm 1.4.3 Sass 3.3.8 Compass 0.12.6
Some things I think have been upgraded, but I think I mostly using the same setup I set up in Advanced Sass/Compass training at Drupal 2014 in Austin (a great training, btw. thanks!)

— Reply to this email directly or view it on GitHub (https://github.com/north/generator-style-prototype/issues/59).

fallenturtle commented 10 years ago

Thank you, your solution got it working again.

Snugug commented 10 years ago

All new watch system, this should no longer be a problem

usman490 commented 7 years ago

when is run gulp && gulp watch. internal/streams/legacy.js:59 throw er; // Unhandled stream error in pipe. help please

InDieTasten commented 7 years ago

I ran into this issue by using arrow function syntax. After switching back to normal function syntax the error disappeared.

Just as info as to what could be causing this issue for future googlers ;)

MauricioR404 commented 4 years ago

I had the same error but not in the images, it was to compile my JS and the solution was to change the syntax of ES6.

[22:33:06] Starting 'scripts' ... internal / streams / legacy.js: 59        throw er; // Unhandled stream error in pipe.        ^ GulpUglifyError: unable to minify JavaScript