-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[vite] Form data not being parsed in actions with custom entry.server and entry.client #8050
Comments
I'm experiencing the same problem when using the Vite plugin. Once I use |
I noticed that your reproduction is using my hacky workaround I wrote in #7819 (comment). (globalThis as any).Request = request.constructor; //NOTE: for now this is the only solution: https://github.com/remix-run/remix/issues/7819 I think It's likely that this would break certain Just in case, I verified |
Btw, thanks for the reproduction! (But, maybe I should stop sharing workaround after workaround since that might just bring more confusing issues elsewhere...) |
@hi-ogawa You're right about the workaround, we were using that but that is obviously a workaround, what you might want to consider is doing something like this: config(config){
config.define = {
globalThis: {
Request: yourRequestPoly.constructor
}
}
} in the remix plugin, this would just extend the global definitions but I'm not sure if this in itself would be a workaround or there is a better solution, just my 2 cents, I'm assuming the PR you made is the actual fix. Thank you for this in any case! |
Thanks for the repro! That really helps a lot. As @hi-ogawa said, it looks like your issue is actually this one: #7819 — and that your issues with form data are due to the fact that the workaround is suppressing the underlying bug rather than fixing it. This issue should be fixed once #8062 is released and the workaround is removed. |
@AlemTuzlak Just to confirm, I was able to fix your form data issue by copying the updated Node adapter from #8062 into your repro's |
Reproduction
https://github.com/AlemTuzlak/formdata-repro
System Info
Used Package Manager
npm
Expected Behavior
submit data is parsed by request.formData and you get it correctly
Actual Behavior
The data is sent over the wire but when you do request.formData() it's empty
Removing entry client and server makes it work again
there is no formData even though it's sent
The text was updated successfully, but these errors were encountered: