Skip to content
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] NextJs 14.2 - Redirect error from server action due to cookie storage #2197

Open
jpcrinon opened this issue Apr 29, 2024 · 1 comment
Labels
bug Something isn't working needs review

Comments

@jpcrinon
Copy link

Link to minimal reproducible example

https://wagmi-redirect-error-nextjs-production.up.railway.app/

Summary

With the lastest nextjs version, redirect from a server action cause an error due to cookie state.
Cookie state json encoding seems to be broken at some point.

Source repo :
https://github.com/jpcrinon/wagmi-redirect-error-nextjs

Stack trace:
⨯ SyntaxError: Unexpected token '%', "%7B%22stat"... is not valid JSON
at JSON.parse ()
at RootLayout (./src/app/layout.tsx:29:85)
at stringify ()
at AsyncLocalStorage.run (node:async_hooks:346:14)

List of related npm package versions

"dependencies": {
"@tanstack/react-query": "^5.32.0",
"@web3modal/wagmi": "^4.1.11",
"next": "^14.2.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"viem": "^2.9.28",
"wagmi": "^2.7.0"
},
"devDependencies": {
"@types/node": "20.11.5",
"@types/react": "18.3.1",
"eslint": "8.56.0",
"eslint-config-next": "14.1.0",
"typescript": "5.3.3"
}

@jpcrinon jpcrinon added bug Something isn't working needs review labels Apr 29, 2024
Copy link

linear bot commented Apr 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs review
Projects
None yet
Development

No branches or pull requests

1 participant