Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. #667

Closed
carrbrpoa opened this issue Oct 26, 2015 · 13 comments
Assignees

Comments

@carrbrpoa
Copy link

Despite of issue 455, I'm still having similar problem.

I'm toggling between my available baselayers (with or without overlays) and sometimes this error comes:

error_toggling_baselayers

And the line pointed in BasemapLayer.js is:

onRemove: function(map){
      // check to make sure the logo hasn't already been removed
      if(this._logo && this._logo._container){
        map.removeControl(this._logo); // Line 232
        map._hasEsriLogo = false;
      }
      (...)

Here's a plnkr: http://plnkr.co/edit/jyXgske9YXYRViqLamBc?p=preview

It's a simplified version of my app, without overlays. See that you just need to start switching the baselayers and in a while the error occurs.

Sometimes it just doesn't loads the selected baselayer due to the error.

Any ideas?

Thanks in advance

@jgravois
Copy link
Contributor

thanks for reporting. i can't reproduce the error when targeting master and leaflet 1.0.0-beta.2, so i'm tempted to just ask you to upgrade to 2.0.0-beta.6 if the chatter in the console bothers you.

var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
var gray = L.esri.basemapLayer('Gray');
var dark = L.esri.basemapLayer('DarkGray');
var topo = L.esri.basemapLayer('Topographic');

var baseMaps = {
  "osm": osm,
  "gray": gray,
  "dark gray": dark,
  "topographic": topo
};

var map = L.map('map', {
    center: [39.73, -104.99],
    zoom: 3
});

L.control.layers(baseMaps).addTo(map);

@carrbrpoa
Copy link
Author

Hey @jgravois, that behavior was actually breaking the code, not just bothering ;)
But ok, changing to last beta versions of everything (leaflet and esri-leaflet) worked.

Thanks

@jgravois
Copy link
Contributor

ok. weird that i didn't see the same thing, but either way, good to know that you were able to upgrade conveniently.

@patrickarlt
Copy link
Contributor

@jgravois reopening this to ask @carrbrpoa a question.

@carrbrpoa What versions of Leaflet/Esri Leaflet were you using that produced the error? I just want to make sure we don't have an error on master or the 1.0.0 version right now.

@patrickarlt patrickarlt reopened this Oct 27, 2015
@carrbrpoa
Copy link
Author

Hey @patrickarlt. Sorry, I overwritted the plnkr. This is a new plnkr with the versions that produced the error (leaflet 0.7.7 or 0.7.5 (the ones I tryed) and esri-leaflet 1.0.0):

http://plnkr.co/edit/saRmlbilSA6mAIDpgIXI?p=preview

@jgravois
Copy link
Contributor

thx @carrbrpoa, I'll figure out what's going on and get a patch in.

@patrickarlt
Copy link
Contributor

Thanks @jgravois assigning to you.

@jgravois
Copy link
Contributor

jgravois commented Nov 1, 2015

i've got this problem fixed in a branch called container-error. it makes sense to me that i can tag 1.0.1 as a patch directly from my commit without merging to master, and i assume that npm will fold the release in appropriately too but i'll wait a bit just in case anyone has any words of caution.

@patrickarlt
Copy link
Contributor

@jgravois yup. Release process should be.

  1. Bump version in package.json
  2. Update the changelog
  3. Commit and push to container-error

I think right now only I have permissions to do an NPM release unless you also have access to the esri_dev account so I can take it from there once you do those steps.

@jgravois
Copy link
Contributor

jgravois commented Nov 2, 2015

unless you also have access to the esri_dev account

i've got the keys.

while i was riding my bike to work this morning i thought of one more thing. what do we do if/when we need to release 1.0.2? if i delete my new branch after tagging it will no longer be in the repository tree. should we maintain a long running 1.x branch going forward?

edit: nevermind, i'm an idiot.

@jgravois
Copy link
Contributor

jgravois commented Nov 2, 2015

  1. Update the changelog

just a note that since we aren't actually ever going to merge 1.x bug fixes back into master, the update to the changelog has to happen in a commit in an entirely seperate Pull Request.

@jgravois
Copy link
Contributor

jgravois commented Nov 2, 2015

i've verified the problem is fixed in 1.0.1. @carrbrpoa thank you so much for taking the time to point out the issue and provide a repro case.

just as an FYI, it was necessary to run the command below to ensure that the patch i tagged isn't considered the 'latest' release on npm

npm dist-tag add esri-leaflet@2.0.0-beta.6 latest

in the future, i'll consider setting a different --tag manually when publishing or adding publishConfig to the package.json.

@jgravois jgravois closed this as completed Nov 2, 2015
@carrbrpoa
Copy link
Author

Thanks for the efforts guys 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants