PANE

Next.js developers face redirect issues with server actions

29 posts since Oct 2022, all from GitHub.

“Issue originale : https://github.com/chapter three/next drupal/issues/349 I followed the way the documentation describes how redirects from drupal can be received from translatePathFromContext. Unfortunatelly the redirects are always empty, even when there are redirects in…”
GitHub
“Link to the code that reproduces this issue https://github.com/kuanjiahong/nextjs middleware redirect issue demo To Reproduce 1. npm run dev 2. Go to http://localhost:3000 3. Click "Go to Dashboard" on "/" page 4. Click "Set Session Cookie" on "/set cookie" page 5. Click "Go to…”
GitHub
“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/dqqhy7 To Reproduce 1. Visit the demo 2. Click the Trigger A redirect button 3. You'll be redirected. The search params you'll see have hello='xyz' (This was expected to be hello=xyz&identifier=yolo) 4…”
GitHub

Developers are encountering problems where redirects initiated by server actions in Next.js take precedence over those from middleware, leading to unexpected routing behavior and incorrect query parameters.

devtoolsnextjsjavascriptwebdevreact
FIT
0%
SIGNAL
50%
SOURCES29
FRESHEST POSTAUG 31
TRACKED SINCE72D AGO

SOURCES (29)

“Issue originale : https://github.com/chapter three/next drupal/issues/349 I followed the way the documentation describes how redirects from drupal can be received from translatePathFromContext. Unfortunatelly the redirects are always empty, even when there are redirects in drupal from same path i am visiting... is there some setting…”

GITHUBAug 24
Source preview · github.com
https://github.com/cloudflare/vinext/issues/3128
github.comAug 31

“Link to the code that reproduces this issue https://github.com/kuanjiahong/nextjs middleware redirect issue demo To Reproduce 1. npm run dev 2. Go to http://localhost:3000 3. Click "Go to Dashboard" on "/" page 4. Click "Set Session Cookie" on "/set cookie" page 5. Click "Go to Dashboard" on "/" page 6. Click "Remove Session" on "/dashboard" page 7. Click "Call Server Action" on "/dashboard" page Current vs. Expected behavior Current behavior After clicking "Remove Session" and then clicking "My”

GITHUBNov 2024

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/dqqhy7 To Reproduce 1. Visit the demo 2. Click the Trigger A redirect button 3. You'll be redirected. The search params you'll see have hello='xyz' (This was expected to be hello=xyz&identifier=yolo) 4. Refresh the page, you'll see the expected params Current vs. Expected behavior Current Behavior: Triggering a redirect from a server action to another route results in the invocation of the middleware, which processes the”

GITHUBOct 2024

“Link to the code that reproduces this issue https://github.com/cuongle hdwebsoft/nextjs bug To Reproduce 1. Start the application in development mode 2. Go to homepage http://localhost:8080/ 3. Click the button Click me , and wait until it alerts Copy clipboard successfully 4. Open server log in the terminal, it will appear == This route is called Current vs. Expected behavior Current behavior: When I use navigator.clipboard.writeText to copy the text, it always request API to my custom route Ex”

GITHUBOct 2024

“Link to the code that reproduces this issue https://github.com/bwilytsch/redirect nextjs repro To Reproduce 1. Setup a new NextJS app using the app router 2. Create two nested routes e.g. /dashboard and /dashboard/getting started 3. Add a layout.tsx server component to /dashboard with a redirect to /dashboard/getting started when a condition is met. 4. In your root page.tsx use the next/link Link component to navigate to /dashboard Current vs. Expected behavior Current next/link component create”

GITHUBOct 2024

“Link to the code that reproduces this issue https://github.com/t3dotgg/t3gallery To Reproduce 1. Start the application in dev. 2. Sign in. 3. Upload an image. 4. Click on the image and then click the delete button. 5. Get an error. Current vs. Expected behavior Repository is taken from Theo's React tutorial: https://youtu.be/d5x0JCZbAJs?si=gxFSgySJO5BoTcB &t=9501. The error pertains to the delete button, the link above opens the video at the appropriate time of when he is setting up the button.”

GITHUBJul 2024

“Link to the code that reproduces this issue https://github.com/devnet uk/nextjs Link Form bug.git To Reproduce 1. Start the application: pnpm run dev 2. Navigate to the application url via any browser: http://localhost:3000 3. Click on the Link component to navigate to the "contact" AppRoute. Once the page has rendered load the browser DevTools to inspect the produced HTML. 4. The form tag action attribute will contain a React rendered Javascript template error message. image This doesn't inhibi”

GITHUBJun 2024

“Link to the code that reproduces this issue https://codesandbox.io/p/devbox/inspiring dan fzvjxl To Reproduce 1. Install nextjs 14 with app router & typescript 2. Create about page in app/about/page.tsx 3. Create Link to home page (/) and about page (/about) 4. Add basePath /admin in file next.config.mjs 5. Run App, yarn dev 6. In the browser, access http://localhost:3000/admin so running well Current vs. Expected behavior First Condition : 1. If initially I access http://localhost:3000/admin an”

GITHUBJun 2024

“Link to the code that reproduces this issue https://github.com/UnnikrishnanBhargavakurup/my minimal nextjs issue reproduction To Reproduce 1. Start the application in development. 2. Navigate to http://localhost:3000/contact. 3. Check the server log. You should observe "/contact" in the browser console, as it is a client side component. Current vs. Expected behavior MobileNav.tsx is defined as a client component but appearing as server component. Verify canary release [X] I verified that the iss”

GITHUBJan 2024

“Link to the code that reproduces this issue https://github.com/anni1236012/nextjsMiddleware To Reproduce 1. yarn dev 2. All pages are protected via middleware except home page. 3. Click on any link other than home page and it should redirect you to /login. 4. Now click on login and it will set the sessionToken cookie with value "loggedin". At this stage, user is authenticated and it should allow users to see the protected pages. 5. Now click on any protected page and you will see the /login page”

GITHUBDec 2023

“Link to the code that reproduces this issue Repro with tanstack query: https://codesandbox.io/p/sandbox/nextjs bug 13 5 4 forked r4zfnj?file=%2Fapp%2Fcharacters.tsx%3A1%2C1 Repro without tanstack query (for some reason, to reproduce you need to open codesandbox browser preview in a new tab and check in server console that root layout was re rendered after browser back navigation): https://codesandbox.io/p/sandbox/nextjs bug 13 5 4 forked z229r9?file=%2Fapp%2Fcharacters.tsx%3A8%2C1 To Reproduce 1”

GITHUBOct 2023

“Link to the code that reproduces this issue https://github.com/serGlazkov/next redirect middleware bug To Reproduce Set up redirects in the next.config.js file. Confirm that the redirects are working as expected. Add a middleware.ts file to the project. Click a link that should trigger a redirect. Current vs. Expected behavior Actual Result The user is redirected to the page, but it's rendered without any properties. Expected Result The user should be redirected to the intended page with all the”

GITHUBSep 2023

“Link to the code that reproduces this issue https://github.com/Rioos/next base bath To Reproduce Configuring the app (you can skip that and strat from here) 1. Create a NextJS app with npx 2. Add 3 routes /index , /[catchRoute] , /subpage/[subpage] 3. The /index route must have a <Link component that directs the user to the /subpage/[subpage] 4. Add a middleware.js that does anything 5. Add a basePath configuration on next.config.js Running and reproducing (you can start from here) 1. Run the ap”

GITHUBSep 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue or a replay of the bug https://codesandbox.io/p/sandbox/gallant khorana tghlz9?file=%2Fnext.config.js To Reproduce I tried reproducing in Codesandbox, but apparently no redirection works (in my link you'll see the p”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Middleware / Edge (API routes, runtime) Link to the code that reproduces this issue or a replay of the bug https://github.com/coneno/nextjs middleware redirect issue To Reproduce Start dev or test server. Using: curl location 'http://localhost:3000/' header 'x forwarded proto: https' header 'x forwarded prot”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue or a replay of the bug https://github.com/ferenckv/next router bug To Reproduce 1. Clone the repo git clone https://github.com/ferenckv/next router bug 2. Go to 13.4.16 cd 13”

GITHUBAug 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) App Router, Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue or a replay of the bug https://nextgram.vercel.app/?par=21 To Reproduce I will get https://nextgram.vercel.app for examples (because my project is private, I cannot public it. I confirmed it still on the”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue or a replay of the bug NA To Reproduce Hi Team, As mentioned in the docs that, Navigating across multiple root layouts will cause a full page load (as opposed to a client side navigation). For example, navigating from /cart that uses app/(shop)/layout.j”

GITHUBJul 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue or a replay of the bug https://github.com/alikleit/next middleware issue To Reproduce Following the documentation from next internationalization using App Directory , with adding a middleware to redirect from the root / to a specific locale /en . This w”

GITHUBMay 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Middleware / Edge (API routes, runtime) Link to the code that reproduces this issue or a replay of the bug https://github.com/stefee/next res status repro/commit/48b14d833ee8bc546a427b5d5fffd6bb9efbced9 To Reproduce Run Open the application Describe the Bug Response status code is 200 Expected Behavior Respo”

GITHUBMay 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/hopeful taussig uvq5g1 To Reproduce Click around to different pages, which are all handled by the same /app/[path]/page.tsx route. Describe the Bug Note that scroll position is prese”

GITHUBMay 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Routing (next/router, next/navigation, next/link) Link to the code that reproduces this issue https://github.com/net/next 13 suspense issue To Reproduce Note that I disabled SSR in the reproduction in app.js with as SSR and Suspense don't play great together. The reproduction uses pages/ and does not use the”

GITHUBMay 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) No response Link to the code that reproduces this issue https://github.com/khuezy/next route To Reproduce Reproduction 1. npm install 2. npm run build 3. Note that the build fails See file: app/(group)/api/hello/route.tsx 4. Move the await someAsyncFunc(); line below the searchParams like: 5. npm run build 6”

GITHUBApr 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Middleware / Edge (API routes, runtime) Link to the code that reproduces this issue https://github.com/wonu/next middleware redirect issue To Reproduce 1. next dev or next start with H 127.0.0.1 2. enter /handler , then redirected to 127.0.0.1:3000 3. enter /middleware , then redirected to localhost:3000 Des”

GITHUBApr 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information node 14 NextJS 13.1.1 Which area(s) of Next.js are affected? (leave empty if unsure) Middleware / Edge (API routes, runtime) Link to the code that reproduces this issue https://codesandbox.io/p/sandbox/floral glitter 3mp1x0?file=%2Fnext.config.js&selection=%5B%7B%22endColumn%22%3A1%2C%22endLineNumber%22%3A11%2C%22startColumn%22%3A1%2C%22startLineNumber%22%3A11%7D%5D Cod”

GITHUBJan 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu 8792.41.9 2/RELEASE ARM64 T6000 Binaries: Node: 16.18.0 npm: 8.19.2 Yarn: 1.22.19 pnpm: N/A Relevant packages: next: 13.1.2 canary.0 eslint config next: 13.1.1 react: 18.2.0 react dom: 18.2.0 Which area(s) of Next.js are affected? (leave empty if u”

GITHUBJan 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information Which area(s) of Next.js are affected? (leave empty if unsure) Middleware / Edge (API routes, runtime) Link to the code that reproduces this issue https://github.com/devklepacki/reproduction middleware redirect To Reproduce 1. Setup project locally, run it and keep the terminal opened 2. In a browser open Network in DevTools and go to http://foobar.localhost:3000 3. Mid”

GITHUBJan 2023

“Verify canary release [X] I verified that the issue exists in the latest Next.js canary release Provide environment information What browser are you using? (if relevant) No response How are you deploying your application? (if relevant) No response Describe the Bug failing with: and it works if I remove < / </ . Not sure if this is the error with nextjs or jest, but got it while migrating to NextJS 13. The original issue is I do something like: <Link ... {user.first name} {user.surname}</Link Exp”

GITHUBOct 2022

SOLUTION LANDSCAPE

Brought to you byTop Sectors

A Player feature.See how many ways this pain can be solved, who's already building, and where the gaps are.

Related panes

/ same corner of the problem