You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After migrating from nodejs 23.3.0 to 23.4.0, I encountered an error in my code. Your fileTypeFromBuffer function gives an error and does not return a value, and naturally my code stops working there. It does not pass to "console.log(fileType)" at all, it gives an error without even getting an empty value, and the fileTypeFromBuffer function stops working! While it worked fine in Node.js 23.3.0, this problem occurred in 23.4.0.
Existing Issue Check
I have searched the existing issues and could not find any related to my problem.
I managed to reproduce the issue, use the previous code sample, parsing: fixture.cr3.
That outputs:
TypeError: (intermediate value).get(...).replace is not a function
at FileTypeParser.parse (file:///C:/Users/Borewit/IdeaProjects/file-type/core.js:613:77)
Looks like a bug in Node.js 23.4.0, in the TextDecoder.decode(): nodejs/node#56219
constencoding='latin1';constbuffer=Buffer.from('Hello!',encoding);// Initializes: <Buffer 48 65 6c 6c 6f 21>consttextDecoder=newTextDecoder(encoding);constdecodedString=textDecoder.decode(buffer);constreturnType=typeofdecodedString;if(returnType==='string'){console.log('Fine, we got a string, as expected');}else{console.error('This is odd, we received an '+returnType);}
Description
After migrating from nodejs 23.3.0 to 23.4.0, I encountered an error in my code. Your fileTypeFromBuffer function gives an error and does not return a value, and naturally my code stops working there. It does not pass to "console.log(fileType)" at all, it gives an error without even getting an empty value, and the fileTypeFromBuffer function stops working! While it worked fine in Node.js 23.3.0, this problem occurred in 23.4.0.
Existing Issue Check
ESM (ECMAScript Module) Requirement Acknowledgment
package.json
contains the following entry:"type": "module"
.File-Type Scope Acknowledgment
The text was updated successfully, but these errors were encountered: