Closed
Description
Operating System
Sonoma 14.5
Browser Version
125.0.6
Firebase SDK Version
10.12.2
Firebase SDK Product:
Storage
Describe your project's tooling
Node JS App with express framework.
Describe the problem
I create the function to get the NodeJS.ReadableStream from firebase/storage getStream() function.
I passed the correct reference already, but the error said that :
TypeError: stream.pipe is not a function
at /Users/aldofebri/Documents/GitHub/pskc-main-api/node_modules/@firebase/storage/dist/index.node.cjs.js:2936:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The error is coming from the code :
static streamBuffer(filename: string){
const fileRef = ref(this.storage, "pdf" + "/" + filename);
const stream = getStream(fileRef);
stream.on('error', (err) => console.log(err));
stream.on('data', (data) => console.log(data));
}
If i'im using the reguler getBytes() like below, the code will work.
async fetchBuffer(filename: string){
const fileRef = ref(this.storage, "pdf" + "/" + filename);
return await getBytes(fileRef);
};
Steps and code to reproduce issue
streamBuffer(filename: string){
const fileRef = ref(this.storage, "pdf" + "/" + filename);
const stream = getStream(fileRef);
stream.on('error', (err) => console.log(err));
stream.on('data', (data) => console.log(data));
}
TypeError: stream.pipe is not a function
at /Users/aldofebri/Documents/GitHub/pskc-main-api/node_modules/@firebase/storage/dist/index.node.cjs.js:2936:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)