-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Actions with latest netlify
preset return 500 due to Response body object should not be disturbed or locked
#1673
Comments
@pi0 I see that in many other presets we're reading in the whole body stream and then passing it back to Nitro as a Buffer: I suspect this is related. In both cases I can see this being added specifically to fix something unspecified. Do we need to do something like this in the new |
Considering Nitro is moving to web standards, we should fix the root cause (other presets will be updated progressively). Can we reproduce it with (unmodified) Nitro alone? (if not it seems a bug with solid/vinxi) |
Whew, finally found the time to try to create a Nitro repro of this, but it seems to work just fine:
So it seems to be specific to SolidStart. Any ideas @ryansolid? or ideas for workarounds? I could maybe look into fixing myself if either of you could give me a little guidance here as there's, uhh, quite a lot going on here I'm a bit wary of diving in without understanding the stories behind all these workarounds. Thanks! |
I admit I have no idea. All the hacks in there were for getting around previous issues we had in various envs and I wasn't involved in implementing any of them. I verified them on various platforms but for the most part it was due to gaps in adapters for those envs. It's possible some of them are no longer needed. If you look one of the comments sounds almost like it was to fix an issue similar to what you are facing by cloning the request rather than using a locked one. It is interesting that no longer works?... |
@ryansolid Thanks, Ryan.
Yeah, I'd have to check again but when I poked around with some added logging a few weeks ago it seemed like this I guess I'll try to dig further when I can find some time. |
@ryansolid @pi0 Hey friends! I finally found some time to poke around and found this fix that works: #1705. What do you think? (One again, I have no idea what I'm doing in here!) |
* fix: handle request body streaming with latest netlify preset See #1673. * add changeset --------- Co-authored-by: Ryan Carniato <ryansolid@gmail.com>
Fixed by #1705. Thanks! 🚀 |
* Added OPTIONS to HTTP_METHODS Array * Added changeset * fix: rename 'Home' route component to 'About' (#1690) ... in about.tsx * temporarily lock examples to vite 5 until we can solve upstream issues * Add clean:all command (#1686) * Add clean:all command * default clean:all * update unocss (#1688) Co-authored-by: Atila Fassina <atila@fassina.eu> * Move docs from root package to /docs package (#1685) * make docs package * remove changeset from docs * type module * use workspace packages for ocs * build packages * take vite out of root * clean docs command * docs:clean --------- Co-authored-by: Atila Fassina <atila@fassina.eu> * Skip typecheck when changing ignored files (#1699) * add copy to clipboard button to code snippet * hotfix deploy path to cloudflare (#1701) * docs: run typecheck, but skip if changes only in landing page * fix: handle request body streaming with latest netlify preset (#1705) * fix: handle request body streaming with latest netlify preset See #1673. * add changeset --------- Co-authored-by: Ryan Carniato <ryansolid@gmail.com> * fix request types * forward set cookies through single-flight * drive solid-start-mdx off a cliff * good riddance * what is that changeset? * v1.0.11 * update lock * Infra: Remove unused dependencies (#1707) * infra: remove turbo * infra: adjust triggers for typecheck task * infra: remove unused graphql * chore: replace shikiji with shiki (#1710) * Added OPTIONS to HTTP_METHODS Array * docs: adjust release notes --------- Co-authored-by: Matthias Hermsen <matthiashermsen@gmail.com> Co-authored-by: Ryan Carniato <ryansolid@gmail.com> Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com> Co-authored-by: Atila Fassina <atila@fassina.eu> Co-authored-by: David Di Biase <1168397+davedbase@users.noreply.github.com> Co-authored-by: Philippe Serhal <philippe.serhal@gmail.com> Co-authored-by: Quetzal Rivera <eptadot799@outlook.com>
Duplicates
Latest version
Current behavior 😯
The page renders "⚠️ Oops, something went wrong".
This is because the Action's
POST /_server
returns a 500.This error is logged on the server:
Expected behavior 🤔
The page should render "✅ Correct!" because the Action returns
true
This works as expected with:
vinxi dev
(doesn't exercise thenetlify
preset)ntl dev
(doesn't exercise thenetlify
preset)netlify-edge
preset instead ofnetlify
netlify-legacy
presetSteps to reproduce 🕹
Steps:
with https://github.com/serhalp/repro-solidstart-nitro-response-body-disturbed (
pnpm i
) and netlify-cli (npm i -g netlify-cli
)ntl serve
or
ntl init
)ntl deploy --build
I've also deployed it here: https://672c1abc039334ad67383d7e--repro-solidstart-response-disturbed.netlify.app/.
Context 🔦
Seems to be similar to #1577...?
If I add some logging here (necessary because the error handling in that function strips the stack trace and all details outside of dev but this bug can only be reproduced in "real" environments) I can see that this is throwing from here.
Your environment 🌎
macOS Monterey 12.7.1 (21G920)
Firefox 131.0.3
The text was updated successfully, but these errors were encountered: