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.

Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

See original GitHub issue

Hey KoRiGaN.

I just installed Vue2-leaflet 0.0.60 to my project and followed your simple example on how to set it up, which works. The problem appears when i’m trying to add a popup or tooltip to my markers. The error happens on load and whenever i hover over a marker / clicks on a marker.

Error:

Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’.

I have the following code:

<v-map :zoom="zoom" :center="center">
    <v-tilelayer :url="url" :attribution="attribution"></v-tilelayer>
        <v-marker v-for="marker in markers" :key="marker.id" :visible="marker.visible" :draggable="marker.draggable" :lat-lng="marker.position">
            <v-popup :content="marker.tooltip" />
            <v-tooltip :content="marker.tooltip" />
      </v-marker>
</v-map>

<script>
import Vue2Leaflet from 'vue2-leaflet';

export default {
    name: 'vuejscomponent',
    components: {
        'v-map': Vue2Leaflet.Map,
        'v-tilelayer': Vue2Leaflet.TileLayer,
        'v-popup': Vue2Leaflet.Popup,
        'v-marker': Vue2Leaflet.Marker,
        'v-tooltip': Vue2Leaflet.Tooltip
    },
    data () {
        return {
            zoom: 14,
            center: [51.505, -0.09],
            url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
            attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
            markers: [
                { id: "m1", position : {lat:51.005, lng:-0.09}, tooltip: "tooltip for marker3", draggable: true, visible: true },
                { id: "m2", position : {lat:50.7605, lng:-0.09}, tooltip: "tooltip for marker4", draggable: true, visible: false }
            ],
            options: { permanent: true, custom: true, className: 'tooltipBox', custom: true, dashOffset: "" }
        }
    }
}
</script>

Got any suggestion how to fix this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:34 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
yokanecommented, Dec 24, 2018

I found same problem. and it solved. That cause is Leaflet’s double import.

show that example, on component,

import {
  L,
  LMap,
  LTileLayer,
  LMarker,
  LPopup,
  LTooltip,
  LLayerGroup
} from "vue2-leaflet";

and on main.js

import L from 'leaflet'
import 'leaflet.icon.glyph'
import 'leaflet/dist/leaflet.css'

After remove section of leaflet is related from main,js, runs successfully. Though it is easy mistake, I’m glad if you can use it as a reference.

0reactions
DonNicoJscommented, Apr 21, 2019

2.0 is released since a while, closing this, feel free to re-open

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to execute 'appendChild' on 'Node': parameter 1 is not ...
This can happen if you accidentally are not dragging the element that does have an id assigned (for example you are ...
Read more >
Uncaught TypeError: Failed to execute 'appendChild' on 'Node'
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. In summation, the issue was that I didn't...
Read more >
Uncaught TypeError: Failed to execute 'appendChild' on 'Node'
Now what i want is when i am trying to use/drag that value and drop is some other place it shows me error....
Read more >
Failed to execute 'appendChild' on 'Node': parameter 1 is not ...
JavaScript : Error: Failed to execute ' appendChild' on 'Node ': parameter 1 is not of type ' Node ' [ Gift :...
Read more >
Failed to execute 'appendChild' on 'Node': parameter 1 is not ...
I am having a problem generating a track list, namely the below mentioned example does not allow access of nodes via querySelector() so...
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