h3-formidable icon indicating copy to clipboard operation
h3-formidable copied to clipboard

All Post requests with body stop working :)

Open Dmytro-Tihunov opened this issue 2 years ago • 5 comments

Environment: Nuxt v3.7.4

A few days ago, I was struggling with a problem in my app. All post requests using useFetch or $fetch with a body stopped working. It seems to be a bug. Tried on 2 different environments. Problem solved after uninstalling the h3-formidable

Dmytro-Tihunov avatar Oct 15 '23 15:10 Dmytro-Tihunov

Did you solve this problem?

sohilpro avatar Oct 29 '23 15:10 sohilpro

Did you solve this problem?

Just install formidable and use it without this plugin ) everything works

Dmytro-Tihunov avatar Oct 29 '23 16:10 Dmytro-Tihunov

Would be nice to know if you used the global middleware when you got this issue

wobsoriano avatar Nov 05 '23 06:11 wobsoriano

got the same issue and yes it was with the middleware

jeremymarc avatar Mar 26 '24 17:03 jeremymarc

What if you ditch the middleware and just do it to certain routes like:

// /server/api/upload.ts
import { readFiles } from 'h3-formidable'

export default eventHandler(async (event) => {
  const { fields, files, form } = await readFiles(event, {
    // formidable options
    // https://github.com/node-formidable/formidable#options
  })
})

wobsoriano avatar May 11 '24 06:05 wobsoriano