-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Unexpected end of form at Multipart._final #369
Comments
Just ran into this issue as well with gcp cloud functions. mscdex/busboy#296 (comment) mentions a solution which I can confirm works in my tests. |
@dedayoa having the same issue in local env with the gcp cloud function. Don't understand how the mscdex/busboy#296 (comment) helps since express-fileupload does not exposes to my knowledge the busboy object. Can you go into more details on how you solved your issue? |
@hugoroussel I was indicating that replacing req.pipe with busyboy.end(req.rawBody) in express-fileupload/lib/processMultipart.js Line 184 in 98028e9
I switched to cloud run instead. |
Same error. FYI I rolled back to 1.3.1 and it worked https://github.com/richardgirges/express-fileupload/releases |
Whats the work around? Im just using this on local machine. |
I recently got the same issue. It happened when I started using the Node.js |
using express with firebase on serverless function
app.ts =>
`import express from 'express';
import bluebird from 'bluebird';
import cors from 'cors';
import passport from 'passport';
import bodyParser from 'body-parser';
import fileUpload from 'express-fileupload';
import router from './routes';
import session from './config/Session';
import * as auth from './auth';
(global.Promise as unknown as typeof bluebird) = bluebird;
const app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(fileUpload());
app.use(cors());
app.use(session);
app.use(router);
app.use(passport.initialize());
app.use(passport.session());
auth.init();
export default app;`
error => Error: Unexpected end of form at Multipart._final
my request is very simple :
export const patch = async (accessToken: string, body?: User, file?: any) => {
let formData
try {
if (file) {
formData = new FormData()
formData.append('file', file)
}
const { data } = await axios.patch(URL, formData || body, {
headers: {
Authorization:
Bearer ${accessToken}
,},
})
return data
} catch (err) {
return console.log(err)
}
}
The text was updated successfully, but these errors were encountered: