-
Notifications
You must be signed in to change notification settings - Fork 30k
[test] Don't use request.allHeaders() in sync page.on() callbacks
#86751
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
base: canary
Are you sure you want to change the base?
Conversation
Failing test suitesCommit: 92af4e8 | About building and testing Next.js
Expand output● app dir - basepath › should only make a single RSC call to the current page (/base/refresh?foo=bar) |
This should avoid running into these issues: ``` request.allHeaders: Target page, context or browser has been closed ``` The sync `headers()` method is sufficient for these use cases: > Note that this method does not return security-related headers, > including cookie-related ones. You can use `request.allHeaders()` for > complete list of headers that include cookie information. Alternative for #86740.
135b74f to
92af4e8
Compare
|
This seems to have uncovered either a bug or a wrong expectation with
@ztanner Is this expected? Repro: |
|
@unstubbable that looks suspiciously like the lazy fetch we do in layout-router when something about the tree mismatches and we don't have anything to render. If that's the case, I think all cases of the lazy fetch occurring is technically a bug (especially in cache components) so we'd need to figure out what's wrong there. |
|
When I tried it, |
Hm, worked just fine here. |
Alternative for #86740.
This should avoid running into these issues:
The sync
headers()method is sufficient for these use cases:Note: The other occurrences of
request.allHeaders()we have are fine because they're used inpage.route()which does handle asynchronous callbacks.