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

From parameter in Middleware is always undefined #954

Open
Jesus82 opened this issue Nov 2, 2023 · 3 comments
Open

From parameter in Middleware is always undefined #954

Jesus82 opened this issue Nov 2, 2023 · 3 comments

Comments

@Jesus82
Copy link

Jesus82 commented Nov 2, 2023

Environment

Build Modules: nuxt/bridge@3.0.0-rc.2-28307913.ff6077a

Reproduction

https://stackblitz.com/edit/github-dwx287-ydqqtk?file=package.json

Describe the bug

Related to #942, now Middleware is working, but from parameter always appear undefined.

Additional context

No response

Logs

No response

@wattanx wattanx added bug Something isn't working pending triage and removed pending triage bug Something isn't working labels Nov 2, 2023
@wattanx
Copy link
Collaborator

wattanx commented Nov 2, 2023

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.

@wattanx wattanx added help wanted Extra attention is needed and removed pending triage labels Nov 2, 2023
@wattanx
Copy link
Collaborator

wattanx commented Nov 4, 2023

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 wattanx added workaround available and removed help wanted Extra attention is needed labels Nov 4, 2023
@Jesus82
Copy link
Author

Jesus82 commented Nov 8, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants