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

255
Views
TypeError: Cannot read properties of null (reading 'subTree')

What does this error mean?

error message

this happens when I put my filteredData variable inside the tr tag of the table.

  <table id="table">
    <tr>
      <th>First name</th>
      <th>Last Name</th>
      <th>Email</th>
      <th>Original email</th>
      <th>Actions</th>
    </tr>
    <template>
      <tr v-if="(fiteredData = '')">
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr
        v-else
        v-for="data in filteredData"
        :key="data.ind_id"
        :value="data.ind_id"
      >
        <td>{{ data.first_name }}</td>
        <td>{{ data.last_name }}</td>
        <td>{{ data.email }}</td>
        <td>{{ data.email }}</td>
        <td>
          <button @click="sendProps(data)">
            <i class="fa-regular fa-edit" aria-hidden="true"></i>
          </button>
        </td>
      </tr>
    </template>
  </table>

This is my method:

  data() {
    return {
      fetchedData: "",
      filteredData: "",
    };
  },
  methods: {
    searchResult(e) {
      this.filteredData = this.fetchedData.filter((data) => {
        return data.email.toLowerCase().includes(this.email.toLowerCase());
      });
      e.preventDefault();
      console.log(this.filteredData);
    }

fetchedData get the data from this:

  async mounted() {
    await axios.get("http://localhost:5000/individuals").then((result) => {
      this.fetchedData = result.data;
      console.log(this.fetchedData);
    });
  },
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I am guessing this: <tr v-if="(filteredData = '')"> should be: <tr v-if="filteredData === ''">, or even beter: v-if="!filteredData.length". You've misspelled the variable name and are accidentally setting it to an empty string rather than doing a comparison (we've all been there, I'm sure)

On a related note, I would initialize fetchedData and filteredData as empty arrays, not strings, because v-for is meant to iterate over objects and arrays, not strings (even though it's probably smart enough to handle it).

about 4 years ago · Juan Pablo Isaza Report
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!