Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
TypeError: Cannot read property 'value' of undefined when calling function

I'm trying to take data from my session but every time I run the tests I get this error

    header-core:   return JSON.parse(window.sessionStorage.getItem(profileDataHeader));
header-core:                                           ^
header-core: TypeError: Cannot read property 'getItem' of undefined
header-core:     at getProfileDataHeader (C:\Users\XXXXX\Documents\YieldPortalHeader\packages\core\src\helpers\utils\/storage.js:9:36)

Code:

const profileData = getProfileDataHeader();

and what the getProfileDataHeader does:

export const getProfileDataHeader = () =>
  JSON.parse(window.sessionStorage.getItem(profileDataHeader));

There are other parts from the code which uses the getProfileDataHeader but none of them returns me this error, only when I make the call in this file in specific.

Can anybody help me? I guess the solution might be pretty stupid but I can't get through it!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!