Giter Site home page Giter Site logo

Comments (13)

dougwilson avatar dougwilson commented on May 5, 2024 1

Ah, gotcha. I will work to get Firefox installed soon and try it out πŸ‘

from connect-multiparty.

dougwilson avatar dougwilson commented on May 5, 2024

Hm, weird. I would love to take a look and figure it out. Can you help provide instruction on how to reproduce so I can take a look? Provide the following, for example:

  1. Version of Node.js
  2. Version of this and all other used modules
  3. Complete server code I can copy and paste and run to see the issue
  4. Instructions on what request (include a copy of the request or code that creates the request) to make to produce the given error.

Thanks!

from connect-multiparty.

vinyll avatar vinyll commented on May 5, 2024

Same here

node --version
v9.5.0

pakages.json

"connect-multiparty": "^2.1.0",
 "express": "^4.16.3",

app.js

const express = require('express')
const app = express()
const multipart = require('connect-multiparty')
const multipartMiddleware = multipart()

app.post('/', multipartMiddleware, (req, res) => {
  console.debug(req.body, req.files)
})

raises the following:

Listening on port 3000

Error: stream ended unexpectedly
    at Form.<anonymous> (/Users/vinyll/Projects/eurordis/receipt-sender/node_modules/multiparty/index.js:754:24)
    at Form.emit (events.js:165:20)
    at finishMaybe (_stream_writable.js:633:14)
    at endWritable (_stream_writable.js:641:3)
    at Form.Writable.end (_stream_writable.js:583:5)
    at IncomingMessage.onend (_stream_readable.js:602:10)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)

from connect-multiparty.

vinyll avatar vinyll commented on May 5, 2024

Seems like it occurs when re-submitting the posted form refreshing the page.
Works fine when browsing back and reclicking on the submit button.

from connect-multiparty.

dougwilson avatar dougwilson commented on May 5, 2024

Hi @vinyll I can definitely take a look. I ran your app, and that error doesn't actually appear. After I copy the app and run it, what are the steps to see the error?

from connect-multiparty.

vinyll avatar vinyll commented on May 5, 2024

The step to reproduce:

  1. run the app
  2. post some file to /
  3. refresh the page and say "continue" when it's warning about posting data again

The error should raise…

from connect-multiparty.

dougwilson avatar dougwilson commented on May 5, 2024

I did try that in Chrome and there wasn't an error. I'm hoping that you can possible some more specific instructions if possible. Maybe the code for how to do the post is different between us? Or the web browser?

from connect-multiparty.

vinyll avatar vinyll commented on May 5, 2024

Good point. I tried with Chromium and Firefox 56 and I had no error risen; it occurs on Firefox 60.

What I do more precisely to reproduce:

  1. run
  2. submit a file
  3. the server loops as there's no response. Ctrl+C to stop the server
  4. restart the server
  5. refresh the page accepting to post again

At this stage I'm wondering if it isn't a bug with FF… :/

from connect-multiparty.

dougwilson avatar dougwilson commented on May 5, 2024

Hi @Akash0333 so I downloaded & installed Firefox 30 and setup my form to do the same thing you described: I have a <form> that makes a POST and then displays "success". I then click on the Reload button and Firefox asks if I want to send the data again. I accept and "success" is displayed again and the form uploaded without an error. Not sure what the difference is between our setups are, though.

Is it possible you can update your above app.js to send an HTML page with a <form> that represents your form? Ideally the less I have to try and make up on the fly, the closer our implementations will get to each other to reproduce the issue.

Also, you're always welcome to submit a fix as a PR as well πŸ‘I want to get this fixed, but I don't (yet) have a way to see the issue to understand what to change.

from connect-multiparty.

vinyll avatar vinyll commented on May 5, 2024

Hey @dougwilson! Why are you talking about Firefox 30?
I can't see a reference from @Akash0333 about it, but maybe I'm missing some message here.

from connect-multiparty.

dougwilson avatar dougwilson commented on May 5, 2024

Sorry that was a typo. I meant Firefox 60 (the current version).

from connect-multiparty.

khataha92 avatar khataha92 commented on May 5, 2024

I have the same issue if I don't send any body from post man to any service. What is the wrong ?? and how to fix it ??

from connect-multiparty.

dougwilson avatar dougwilson commented on May 5, 2024

Open a new issue with complete code and steps to reproduce the issue so we can figure it out.

from connect-multiparty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.