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
Create a new basic remix app with cmd npx create-remix@latest.
Enable single-fetch in vite.config.ts: unstable_singleFetch: true,
Attempt to call response.headers.entries() in the loader of index route _index.tsx. I added the following loader to the route to check for listing headers:
// loader for _index.tsxexportconstloader: LoaderFunction=({ response })=>{if(!response)returnnull;console.log("response is defined.");response.headers.append("Location","https://remix.run");console.log("response has following headers:");for(constheaderofresponse.headers.entries()){console.log(header);}returnnull;};
Running the app both in development (npm run dev) and production (npm run build; npm run start) mode should list the headers from the Response Stub.
Console output for above mentioned loader:
response is defined.
response has following headers:
[ 'location', 'https://remix.run' ]
Actual Behavior
Running the app in development mode (npm run dev) will not throw any errors and will log the headers correctly. But when running in production mode (npm run build; npm run start), the same route will throw error.
Error thrown in the production build for index route using loader mentioned above:
[remix-serve] http://localhost:3000 (http://192.168.1.96:3000)
response is defined.
response has following headers:
TypeError: Cannot read private member #headersList from an object whose class did not declare it
at Proxy.get [headers map sorted] (/Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/undici/lib/web/fetch/headers.js:550:14)
at Reflect.get (<anonymous>)
at Object.get (/Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/@remix-run/server-runtime/dist/single-fetch.js:289:22)
at FastIterableIterator.next (/Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/undici/lib/web/fetch/util.js:870:34)
at loader (file:///Users/siddhant.c.gupta/Projects/GS/remix-sf/build/server/index.js?t=1722288481604.003:139:14)
at Object.callRouteLoader (/Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/@remix-run/server-runtime/dist/data.js:66:22)
at handler (/Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/@remix-run/server-runtime/dist/routes.js:54:39)
at actualHandler (/Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/@remix-run/router/router.ts:4803:14)
at /Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/@remix-run/router/router.ts:4815:58
at /Users/siddhant.c.gupta/Projects/GS/remix-sf/node_modules/@remix-run/server-runtime/dist/single-fetch.js:57:90
In any case the output of both development and production builds should be the same. Either both should throw error or both should list the headers.
The text was updated successfully, but these errors were encountered:
Reproduction
npx create-remix@latest
.vite.config.ts
:unstable_singleFetch: true,
response.headers.entries()
in the loader of index route_index.tsx
. I added the following loader to the route to check for listing headers:System Info
Used Package Manager
npm
Expected Behavior
Running the app both in development (
npm run dev
) and production (npm run build; npm run start
) mode should list the headers from the Response Stub.Console output for above mentioned loader:
Actual Behavior
Running the app in development mode (
npm run dev
) will not throw any errors and will log the headers correctly. But when running in production mode (npm run build; npm run start
), the same route will throw error.Error thrown in the production build for index route using loader mentioned above:
In any case the output of both development and production builds should be the same. Either both should throw error or both should list the headers.
The text was updated successfully, but these errors were encountered: