Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue.js won't tell me line number of error

Line 8 and 23 aren't calling length why isn't vue telling me the line number of the error?

    vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in render: "TypeError: Cannot read property 'length' of undefined"

found in

---> <IsoDeals> at src/views/iso/Deals.vue
       <VContent>
         <VApp>
           <App> at src/App.vue
             <Root>
vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property 'length' of undefined
    at Proxy.render (eval at ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1c8c67b2-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/iso/Deals.vue?vue&type=template&id=13ff2f9a&scoped=true& (8.js:23), <anonymous>:235:70)
    at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3548)
    at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4066)
    at Watcher.get (vue.runtime.esm.js?2b0e:4479)
    at new Watcher (vue.runtime.esm.js?2b0e:4468)
    at mountComponent (vue.runtime.esm.js?2b0e:4073)
    at VueComponent.Vue.$mount (vue.runtime.esm.js?2b0e:8415)
    at init (vue.runtime.esm.js?2b0e:3118)
    at merged (vue.runtime.esm.js?2b0e:3301)
    at createComponent (vue.runtime.esm.js?2b0e:5978)

I figured out that this is the code that was erroring out. Lines 16 - 26. With leads.length being called on line 24. So why isn't vue telling me these line numbers?

          <v-data-table
            :headers="leadHeaders"
            :items="leads"
            :items-per-page-options="[
              10,
              20,
              { text: '$vuetify.dataIterator.rowsPerPageAll', value: -1 }
            ]"
            :hide-default-footer="leads.length < 10"
            class="elevation-1"
          >
like image 508
BamBam22 Avatar asked Oct 20 '25 18:10

BamBam22


1 Answers

Why isn't vue telling me the line number of the error?

Because it isn't supported, at least in version 2. Keep an eye on version 3; there are some improvements being made in the way the source maps are calculated.

like image 133
Decade Moon Avatar answered Oct 22 '25 07:10

Decade Moon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!