Comments (5)
This is expected, when you do a redirect after a POST, the browser sends a new GET to the target location, so any response body sent by the POST is lost.
from remix.
@sergiodxa it seems 307 doesn't work correctly either. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307
I've updated accordingly
from remix.
You're losing the ?index
query param when you do Location: url.pathname
so the POST that is re-sent is trying to hit the root route action and there isn't one, so you're getting a 405. If you need to re-POSt to the same action you'll need to append ?index
to your Location
header (and then avoid redirect loops in some way 😉 ).
from remix.
@brophdawg11 @sergiodxa I guess what I'm wondering is how I could potentially achieve something like this as highlighted by @ryanflorence in roadmap 8. https://youtu.be/fHel4d-It5Q?list=PLXoynULbYuEDR_w8LJKRIkGheWpFfiMiR&t=757 while retaining the state of the submission if this is even a reasonable expectation?
from remix.
That video is mostly talking in hypotheticals - could you outline exactly the UX you're trying to achieve so we're on the same page? 303 redirects are not intended to preserve the submission body, while 307/308's are intended to preserve the submission body.
from remix.
Related Issues (20)
- Firestore Lite Does Not Work in Loader HOT 5
- Stdio pipe impacts plugin shutdown
- TypeScript: useLoaderData is not working properly in 2.9 HOT 10
- Unexpected Server Error TypeError: Cannot read properties of null (reading 'useEffect') HOT 2
- Hydration Errors When Deferred Promise Rejects HOT 1
- useFetcher return type is `any` since upgrading to remix 2.9.0 HOT 2
- install.js.map hook HOT 3
- 2.9.1: useFetcher/useLoaderData types are set to never HOT 8
- Single fetch `response` parameter for loader is undefined if no default export exists in the route HOT 8
- useLoaderData<typeof loader> returns type JsonifyObject<T> rather than T HOT 6
- Single Fetch Issues HOT 9
- Single Fetch: bad behavior in promises that resolve to `undefined` and `null` HOT 3
- Single fetch: loader type us unknown HOT 6
- Single Fetch: missing type for useLoaderData<typeof clientLoader>() HOT 6
- Application crashes on unhandled promise rejection in deferred data HOT 5
- [VitePlugin] HMR breaks with imagetools transformer Vite plugin HOT 1
- Testing utilities have wrong types for meta functions HOT 1
- remix-express/server throws error on IPv6 host or X-Forwarded-Host HOT 3
- `remix dev` fails when workspace has a deprecated node-builtin in unrelated package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remix.