Skip to content
← Back to activity

Public problem

Cloudinary: uploading file as buffer fails in production (Next.js)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

In a Next.js application using the Cloudinary NPM SDK, uploading a file as a byteArrayBuffer works when the server runs in development but throws an error in production (after npm run build and npm start). The failure came from how upload_stream handled buffers in the production bundle, not from app code.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Upgrade the Cloudinary Node SDK to v2.0.3 or later: the production upload_stream buffer bug was fixed there, and both the reporter and another user confirmed uploads now work for jpg, png, and svg in production. If you must stay on the old version, send the file as a stream instead of a buffer.

Source: https://github.com/cloudinary/cloudinary_npm/issues/650