question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

stream.on is not a function

See original GitHub issue

Hi, in fastify-cli we have a report of this error with the v1.6.0 release:

To reproduce:

npx fastify-cli generate pretty
cd pretty/
npm i
// edit the package.json adding "-P" flag in the start script
npm start 
// now we have the error

// to solve:
npm ls pino-colada
// you should see 1.6.0

// installing previous version works:
npm i pino-colada@1.5.1
npm start
// all works fine

There are some fixes we should apply to our code base? We use pino-colada here: https://github.com/fastify/fastify-cli/blob/b6e7caba7e8f2644f5243f9d94902faacfbda886/start.js#L98-L102

Thanks

The stack trace:

  stream.on('close', function () {
         ^
TypeError: stream.on is not a function
    at destroyer (C:\Users\behem\workspaceFastify\asd\boooom\node_modules\pump\index.js:26:10)
    at C:\Users\behem\workspaceFastify\asd\boooom\node_modules\pump\index.js:70:12
    at Array.map (<anonymous>)
    at pump (C:\Users\behem\workspaceFastify\asd\boooom\node_modules\pump\index.js:67:26)
    at runFastify (C:\Users\behem\workspaceFastify\asd\boooom\node_modules\fastify-cli\start.js:101:5)
    at start (C:\Users\behem\workspaceFastify\asd\boooom\node_modules\fastify-cli\start.js:50:10)

Original issue ref: https://github.com/fastify/fastify-cli/issues/235

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pc3b3rcommented, Mar 30, 2020

I confirm, it’s working fine, tried right now.

1reaction
lrlnacommented, Mar 30, 2020

@mcollina npm didn’t let me unpublish, i did try on friday.

Therefore, I’ve published 1.5.1 as 1.6.1. Let me know if something is off. Hopefully that means you don’t have to lock it anymore!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why TypeError: stream.on is not a function - Stack Overflow
I have written a set of gulp commands to uglify/remove comments from JS code. Since I wanted to trace the exceptions properly, I...
Read more >
TypeError: stream.on is not a function · Issue #167 - GitHub
This is most likely due to you using the wrong version of a custom plugin. We migrated away from streams to promises last...
Read more >
How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
Read more >
Using readable streams - Web APIs | MDN
You write a function that starts off by reading the stream. If there is no more stream to read, you return out of...
Read more >
Node.js Stream.pipeline() Method - GeeksforGeeks
... not accomplished. Return Value: It returns a cleanup function. Below examples illustrate the use of stream.pipeline() method in Node.js:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found