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.

pass generate api stream is undefined

See original GitHub issue

Hi, I am getting undefined stream on using the following code. I dont see any error in my catch either. Please help as I am relatively new to this. The stream is undefined.

app.get('/downloadpass', async (req, res, next) => {
 let examplePass = new Pass({
     model: "./passModels/Coupon",
     certificates: {
         wwdr: "./certs/wwdr.pem",
         signerCert: "./certs/signerCert.pem",
         signerKey: {
             keyFile: "./certs/passkey.pem",
             passphrase: "12345"
         }
     },
     overrides: {
         // keys to be added or overridden
         serialNumber: "AAGH44625236dddaffbda"
     },
     // if true, existing keys added through methods get overwritten
     // pushed in queue otherwise.
     shouldOverwrite: true
 });
  
 // Adding some settings to be written inside pass.json
 examplePass.barcode("36478105430"); // Random value
  
 // Generate the stream, which gets returned through a Promise
 try {
  let stream = await examplePass.generate();
  stream.pipe(res)
  
} catch (e) {
  //this will eventually be handled by your error handling middleware
  console.log(e) 
}
})

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ksainecommented, Apr 30, 2019

Thank you for your work. =)

1reaction
alexandercerutticommented, Apr 30, 2019

@nikhilenmudi if you see this commit, you can see that there was a throw that I, mistakenly, forgot to re-introduce when I moved to async/await.

Oh, awesome 😂. So both projects were not working for different reasons. 😂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript/stream Variable undefined - node.js - Stack Overflow
1 Answer 1 ... Stream event finish informs that operation is done, and passes no arguments. See https://nodejs.org/api/stream.html# ...
Read more >
Stream | Node.js v19.3.0 Documentation
The node:stream module is useful for creating new types of stream instances. ... depends on the highWaterMark option passed into the stream's constructor....
Read more >
Using readable streams - Web APIs | MDN
If the stream becomes closed, the promise will be fulfilled with an object of the form { value: undefined, done: true } ....
Read more >
Streams—The definitive guide - web.dev
The Streams API allows JavaScript to programmatically access streams of data received over the network and process them as desired.
Read more >
Streaming Files | NestJS - A progressive Node.js framework
A StreamableFile is a class that holds onto the stream that is to be returned. To create a new StreamableFile , you can...
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