hviana/Upload-middleware-for-Oak-Deno-framework

UnexpectedEof at MultipartReader.nextPart

Opened this issue · 0 comments

Using the middleware works fine when running Deno straight from Source:

deno run --allow-net --allow-run --allow-read --allow-write --allow-env --unstable server/serve.ts

For production, i attempted to create a bundle and then run the server through that:

deno bundle --unstable server/serve.ts > serve.js
deno run --allow-net --allow-run --allow-read --allow-write --allow-env --unstable serve.js

Now, when sending a POST request with an upload, the application responds with Internal Server Error. I was able to track down the error to

const form = await mr.readForm(0);

UnexpectedEof
    at MultipartReader.nextPart (file:///workdir/serve.js:11025:23)
    at async MultipartReader.readForm (file:///workdir/serve.js:10940:23)
    at async file:///workdir/serve.js:12323:26
    at async dispatch (file:///workdir/serve.js:4667:13)
    at async dispatch (file:///workdir/serve.js:4667:13)
    at async dispatch (file:///workdir/serve.js:4667:13)
    at async Application.#handleRequest (file:///workdir/serve.js:6961:17)