title: [Vue warn]: Error in callback for watcher TypeError: Cannot use 'in' operator to search for
body: <p>I have this data and computed method is also there</p>
  <pre class="lang-js prettyprint-override"><code>data(){
      return {
          pdf_path:'',
          medical: {
              name: '',
              designation: '',
              account_no: '',
              staff_no: '',
          },
       }
  },
  
  computed:{ 
      getFilePath: function () {  
          if(this.pdf_path!=&quot;&quot;){
              return '../../../../storage/' + this.pdf_path + '?t=' + new Date().getTime();
          }
      }
  },
  
  async mounted(){
      const header = {
          'Authorization': 'Bearer ' + this.getLoginUserData,
      };
      await axios.get('/api/backend/users',{headers:header}).then((responseUser) =&gt; {
          this.medical.name = responseUser.data.name;
          this.medical.account_no = responseUser.data.account_no;
          this.medical.staff_no = responseUser.data.userUniqueId;
          this.medical.designation = responseUser.data.role_id;
          return axios.get(`/api/backend/dependent-list/${this.userId}`,{headers:header}); 
      });
  },
  </code></pre>
  <p>In the template i'm using the computed property:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;iframe :src=&quot;`${getFilePath}`&quot; width=&quot;100%&quot; height=&quot;350px&quot; type=&quot;application/pdf&quot;&gt;&lt;/iframe&gt;
  </code></pre>
  <p>but if i use computed property then i get error in console</p>
  <blockquote>
  <p>[Vue warn]: Error in callback for watcher &quot;medical.name&quot;: &quot;TypeError:
  Cannot use 'in' operator to search for 'name' in null&quot;</p>
  </blockquote>
  <p>Should i have to initialize all variable in computed method?</p>