Problem:
I have deployed my Nuxt.js project on Vercel and am encountering an issue with my setTokenManager server middleware, which is not functioning as expected. In my local environment, everything works fine, but in the Vercel deployment, the token is returned as null.
How can I create a reproduction?
Please use one of the following links to reproduce your issue.
- https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
- https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox
Please ensure that the reproduction is as **minimal** as possible. This will allow us to isolate the issue as best as possible.
Here are some more amazing posts about the importance of reproductions:
- [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required)
- [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/minimal-reproducible-example)
Environment
No response
Reproduction
No response
Describe the bug
Title: Issue with
setTokenManager
Server Middleware Not Working Properly in Vercel DeploymentDescription:
Environment:
Problem: I have deployed my Nuxt.js project on Vercel and am encountering an issue with my
setTokenManager
server middleware, which is not functioning as expected. In my local environment, everything works fine, but in the Vercel deployment, thetoken
is returned asnull
.Code Snippet:
Issue Details:
getToken
function, when invoked, doesn't retrieve the expected token. Instead, it returnsnull
.event
.Troubleshooting Done:
setCookie
function.Additional Context: Here is the console output of the
event
object: