unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

error when using with `webpack-dev-middleware` #2541

Open danielroe opened 3 months ago

danielroe commented 3 months ago

Environment

Nitro v2.9.6

Reproduction

nitro & webpack-dev-middleware (Sorry, stackbliz doesn't seem to work.) https://stackblitz.com/edit/github-yqcgdy

express & webpack-dev-middleware (not reproduced) https://stackblitz.com/edit/github-mawhuh

Strangely, with nitro, the requested bundle is broken.

reproduction from @wattanx

Describe the bug

When loading a webpack bundle, long lines can be truncated and therefore invalid JS is returned.

Additional context

originally https://github.com/nuxt/nuxt/issues/26951

Logs

No response