question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LGeoJson beforeDestroy error

See original GitHub issue

Description

On destroy of parent component of LGeoJson component LGeoJson component has the following error:

vue.runtime.esm.js?2b0e:1737 TypeError: Cannot read property 'removeLayer' of undefined
    at VueComponent.beforeDestroy (vue2-leaflet.min.js?458e:1)
    at callHook (vue.runtime.esm.js?2b0e:2917)
    at VueComponent.Vue.$destroy (vue.runtime.esm.js?2b0e:2696)
    at destroy (vue.runtime.esm.js?2b0e:4174)
    at invokeDestroyHook (vue.runtime.esm.js?2b0e:5739)
    at VueComponent.patch [as __patch__] (vue.runtime.esm.js?2b0e:6077)
    at VueComponent.Vue.$destroy (vue.runtime.esm.js?2b0e:2719)
    at destroy (vue.runtime.esm.js?2b0e:4174)
    at invokeDestroyHook (vue.runtime.esm.js?2b0e:5739)
    at invokeDestroyHook (vue.runtime.esm.js?2b0e:5744) 

Component structure

-> <LGeoJson>
       <PageComponent>
         <LMap>
           <ComponentContainingLMap>
             <ProjectMainRouter>
               <App>
                 <Root>

the error seems to be caused by the above structure as, a direct child parent relationship between LMap and LGeoJson doesn’t result in any error

Steps to Reproduce

Expected Results

No error

Actual Results

Error

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Leaflet: - not a project dependency directly
  • Vue: v2.5.17
  • Vue2Leaflet: v1.0.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DonNicoJscommented, Oct 9, 2018

@pixelizedPeanut as I mentioned in the previous post: can you try to install vue2leaflet like this: “vue2-leaflet”: “git+https://github.com/KoRiGaN/Vue2Leaflet.git#next” and see if this resolve your issue ?

0reactions
pixelizedPeanutcommented, Oct 9, 2018

will keep an eye open 😃 Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is beforeDestroyed function not working? - Stack Overflow
setInterval returns an interval, which is used to clear the interval, which means that you need to store the setInterval returned value into ......
Read more >
Autocomplete hook beforedestroy issue. HELP - Quasar forum
I can't seem to use autocomplete in my component. I always got this error. I also made sure that it was imported already...
Read more >
Vue js tutorial for beginners # 21 beforeDestroy and destroyed ...
this is vuejs tutorial we learn what is a beforeDestroy and destroyed a method in vue life cycle hooks in vue js with...
Read more >
Ensure AWS API GATEWAY enables Create before Destroy
Error: AWS API Gateway does not enable Create before Destroy Bridgecrew Policy ID: BC_AWS_GENERAL_152Checkov Check ID: CKV_AWS_237Severity: LOW.
Read more >
Focus management with Vue refs - Learn web development
If you open your console, you'll see an error raised along the lines ... beforeDestroy() — Runs before a component is removed from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found