No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [Error] [Vue warn]: Error in nextTick: "TypeError: Cannot read property 'removeChild' of null"

    Help
    2
    6
    1339
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Hawkeye64
      Hawkeye64 last edited by Hawkeye64

      I am getting this error in the QTooltip in a QTr/QTd:

      found in
      
      ---> <QTooltip>
             <QTd>
               <QTr>
                 <QTable>
                   <LiveViewTable> at src/components/LiveViewTable.vue
                     <Archive> at src/pages/Archive.vue
                       <QPageContainer>
                         <QLayout>
                           <LayoutDefault> at src/layouts/default.vue
                             <App> at src/App.vue
                               <Root>
      

      Last line is the offending code:

        mounted () {
          this.$nextTick(() => {
            /*
              The following is intentional.
              Fixes a bug in Chrome regarding offsetHeight by requiring browser
              to calculate this before removing from DOM and using it for first time.
            */
            this.$el.offsetHeight // eslint-disable-line
      
            this.anchorEl = this.$el.parentNode
            this.anchorEl.removeChild(this.$el)
      

      My HTML:

                <q-td key="message" :props="props">
                  <q-tooltip v-if="props && canShowPopover(props.row)" anchor="top middle" self="bottom middle">{{ getMessagePopover(props.row) }}</q-tooltip>
                  {{ getMessage(props.row) }}
                </q-td>
      

      And the functions:

          getMessage: function (row) {
            if (row.message.length > this.truncateLength) {
              return row.message.substring(0, this.truncateLength) + '...'
            }
            return row.message
          },
      
          canShowPopover: function (row) {
            if (row && row.message) {
              return row.message.length > this.truncateLength
            }
            return false
          },
      
          getMessagePopover: function (row) {
            return row.message
          },
      

      Has anyone else seen this? Is this a legitimate bug?
      @rstoenescu

      Maybe the code should read like this:

      this.anchorEl = this.$el.parentNode
      if (this.anchorEl) {
            this.anchorEl.removeChild(this.$el)
      }
      

      I should mention this works fine on existing data. It’s when data is dynamically added to the row.

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by s.molinari

        It’s not exactly like your code, but it seems to work without errors. 😄

        https://jsfiddle.net/smolinari/6x9puefn/

        Scott

        1 Reply Last reply Reply Quote 1
        • Hawkeye64
          Hawkeye64 last edited by Hawkeye64

          I forked your sample to be more like what I am doing and not seeing the error in colsole either:

          https://jsfiddle.net/Hawkeye64/am7fj436/2/

          But, for the life of me, I can’t figure out why this.anchorEl ends up being null.

          1 Reply Last reply Reply Quote 0
          • Hawkeye64
            Hawkeye64 last edited by

            Maybe jsfiddle doesn’t show the console error because it’s hosted in an iframe?

            1 Reply Last reply Reply Quote 0
            • Hawkeye64
              Hawkeye64 last edited by

              I changed it to a v-show (instead of the v-if) and I no longer get the issue. Still would like to know why. 😞

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by

                Yeah. Sounds strange.

                Scott

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post