uploadthing icon indicating copy to clipboard operation
uploadthing copied to clipboard

[bug]: express adapter breaks when using `body-parser`

Open juliusmarminge opened this issue 1 year ago โ€ข 2 comments

Provide environment information

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 106.48 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/Library/Caches/fnm_multishells/30733_1706613602105/bin/node
    npm: 10.2.4 - ~/Library/Caches/fnm_multishells/30733_1706613602105/bin/npm
    pnpm: 8.14.1 - ~/Library/Caches/fnm_multishells/30733_1706613602105/bin/pnpm
    bun: 1.0.25 - ~/.bun/bin/bun
  Browsers:
    Chrome: 121.0.6167.85
    Safari: 17.2.1
  npmPackages:
    typescript: ^5.3.3 => 5.3.3

Describe the bug

this breaks:

CleanShot 2024-01-30 at 09 32 33@2x

move the bodyparser middleware below the uploadthing route handler to fix it. the new logs helps narrow down the issue but we can probably make this scenario work

Link to reproduction

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡

To reproduce

see #586

Additional information

No response

๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributing

  • [ ] ๐Ÿ™‹โ€โ™‚๏ธ Yes, I'd be down to file a PR fixing this bug!

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

juliusmarminge avatar Jan 31 '24 09:01 juliusmarminge

if anyone using express would like to take a deeper dive feel free - I probably wont spend time on this for a while unless it becomes a higher priority issue

probably just needs a check to see if body is already parsed then use that - else parse it manually

juliusmarminge avatar Jan 31 '24 09:01 juliusmarminge

The issue cannot be reproduced anymore

MustafaEminn avatar Jun 09 '24 11:06 MustafaEminn