#ExperimentalWarning: buffer.File

1 messages · Page 1 of 1 (latest)

slim rune
#

Hello guys, I'm getting the following warning on my Node.
could someone please help me understand what this warning means and how to fix it?

//my terminal
npm run dev

[email protected] dev
ts-node-dev --respawn --transpile-only server.ts

Server listening on port 3001
Database connected with host: ac-ge42qyw-shard-00-02.uqdf1xv.mongodb.net
(node:9828) ExperimentalWarning: buffer.File is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)

//my code
try {
const document = req.file;
const formData = new FormData();
const fileBlob = new Blob([fs.readFileSync(document.path)], {
type: document.mimetype,
});
formData.append('document', fileBlob, document.originalname);
formData.append('signature', signature);

const response = await axios.post(
'https://localhost:3001/document/upload',
formData,
{
headers: {
'Content-Type': multipart/form-data,
apikey: clientId,
},
//httpsAgent: new https.Agent({ rejectUnauthorized: false }),
}
);

res.status(200).json({
success: true,
data: response.data,
});
} catch (error: any) {
console.log(error);
return next(new ErrorHandler(error.message, 400));
}

hasty sentinel
#

In the particular version of node you're using, that feature is marked as experimental

#

Pretty much as it says

#

In v20 it was marked as stable