You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom"react";import{defer,json}from"@remix-run/node";exportconstloader=async({ params, context })=>{// with json, no problem// return json(// with defer, in `headers`, `loaderHeaders.get("x-custom-header-from-loader")`// returns null.returndefer({whatever: "stuff"},{headers: {"x-custom-header-from-loader": "value from loader",},});};exportconstheaders=({ loaderHeaders })=>{console.log("Header from loader",loaderHeaders.get("x-custom-header-from-loader"));return{"x-customer-header": loaderHeaders.get("x-custom-header-from-loader"),};};exportdefaultfunctionBugHeader(){return<p>Bug header?</p>;}
Expected Behavior
in headers, loaderHeaders.get("myheader") should return the value set in loader
Actual Behavior
it seems loaderHeaders.get("myheader") always return null
The text was updated successfully, but these errors were encountered:
What version of Remix are you using?
1.11.1
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
I followed https://remix.run/docs/en/v1/route/headers and https://remix.run/docs/en/v1/guides/streaming but it looks like retrieving the headers sent by
loader
fromheaders
does not work when theloader
uses adefer
(withjson
it works perfectly)To reproduce use the following route:
Expected Behavior
in
headers
,loaderHeaders.get("myheader")
should return the value set inloader
Actual Behavior
it seems
loaderHeaders.get("myheader")
always returnnull
The text was updated successfully, but these errors were encountered: