bridge
bridge copied to clipboard
From parameter in Middleware is always undefined
Environment
Build Modules: nuxt/[email protected]
Reproduction
https://stackblitz.com/edit/github-dwx287-ydqqtk?file=package.json
Describe the bug
Related to https://github.com/nuxt/bridge/issues/942, now Middleware is working, but from parameter always appear undefined.
Additional context
No response
Logs
No response
It seems that in Nuxt 2, from is undefined if reloaded.
https://stackblitz.com/edit/github-dwx287-bmmrvv
I don't know if it can be made to work the same as Nuxt 3, but I will investigate.
On the initial visit, from becomes undefined. (same behavior for router middleware)
The from is present when client navigation is used.
(For example, when transitioning from index to next-page, from is defined.)
It behaves differently from nuxt 3, but I don't think it will hinder the transition, so I'll put a workaround available label on it.
@wattanx thanks for the insight.
Just to add to this, I'm using it for redirects, so even if it is possible to test it like that for other functionalities, for this it is difficult to make it work if first load is undefined.