TypeError: Cannot read private member #headersList from an object whose class did not declare it #68849
Replies: 5 comments 8 replies
-
|
Do you also get the error locally with |
Beta Was this translation helpful? Give feedback.
-
|
I still have the problem even after doing all that. What is the actual fix? |
Beta Was this translation helpful? Give feedback.
-
|
I resolved the issue by removing console.log('[Page] headers', headers()). Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Hi,
Yes as headers have private members which were getting accessed. If you
need you can iterate using functions provided than console will also work.
Regards,
Kumar
…On Tue, Sep 24, 2024 at 12:00 PM Nayeon Kim (Jupi) ***@***.***> wrote:
I resolved the issue by removing console.log('[Page] headers', headers()).
Thanks!
—
Reply to this email directly, view it on GitHub
<#68849 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADK64R3Z76T44SSXIS2VRYDZYGEBVAVCNFSM6AAAAABMO3SKX6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZUGEZDSNI>
.
You are receiving this because you were mentioned.Message ID: <vercel/next
.***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Using App Router when using next/headers getting this on Node 20.16.0 Linux EC2 instance.
const headersList = headers();
this is what I am using in page.tsx
getting this on server. Server is expecting headers from SSO FR. Next 14.2.3 React 18.3.1
0|dashboar | TypeError: Cannot read private member #headersList from an object whose class did not declare it
0|dashboar | at [nodejs.util.inspect.custom] (node:internal/deps/undici/undici:8647:64)
0|dashboar | at formatValue (node:internal/util/inspect:806:19)
0|dashboar | at inspect (node:internal/util/inspect:365:10)
0|dashboar | at formatWithOptionsInternal (node:internal/util/inspect:2304:40)
0|dashboar | at formatWithOptions (node:internal/util/inspect:2166:10)
0|dashboar | at console.value (node:internal/console/constructor:349:14)
0|dashboar | at console.log (node:internal/console/constructor:386:61)
0|dashboar | at d (/apps/opt/data/sor-nbs-recon-dashboard-service-ui/dist/server/app/new-user/page.js:1:2693)
0|dashboar | at eh (/apps/opt/data/sor-nbs-recon-dashboard-service-ui/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786)
0|dashboar | at e (/apps/opt/data/sor-nbs-recon-dashboard-service-ui/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671) {
0|dashboar | digest: '463973562'
0|dashboar | }
Beta Was this translation helpful? Give feedback.
All reactions