Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda