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

242
Views
JsException: TypeError: Undefined and null dont have properties

I searched everywhere to find the solution, but I find none of them are relevant to mine.

I tried to store a variable in local storage, but I'm getting the below error:

raise MakeError('TypeError',
JsException: TypeError: Undefined and null dont have properties (tried getting property 'setItem')

So I checked whether it is running on browser,

if (typeof window !== 'undefined') {
    console.log('You are on the browser')
    if(message1!='undefined'){
        console.log("message1 is not undefined")
        window.localStorage.setItem("vOneLocalStorage",message1);
    }
    
  }

Before giving the error, it printed "You are in the browser" in console, which I gave in the code to test

output in console before giving the error

I don't understand what is the cause, and why is it not able to store the variable in the local storage.

The tech stack I use are Javascript, React, python, and Js2py library to pass input from Python to Javascript.

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!