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

Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node' #47

Open
vjpr opened this issue Sep 20, 2015 · 5 comments
Open

Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node' #47

vjpr opened this issue Sep 20, 2015 · 5 comments

Comments

@vjpr
Copy link

vjpr commented Sep 20, 2015

I receive this error ocassionally.

Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
  window.(anonymous function).(anonymous function) @ leaflet.utfgrid.js:257
  (anonymous function) @ tile.json?callback=lu0.lu_3_7_1:1

This is the code:

        window[wk][functionName] = function (data) {
            self._cache[key] = data;
            delete window[wk][functionName];
            head.removeChild(script); // <--
            self._finish_request(key);
        };
@vjpr vjpr changed the title Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.window.(anonymous function).(anonymous function) @ leaflet.utfgrid.js:257(anonymous function) @ tile.json?callback=lu0.lu_12_2047_2048:1 leaflet.utfgrid.js:257 Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.window.(anonymous function).(anonymous function) Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node' Sep 20, 2015
@danzel
Copy link
Owner

danzel commented Sep 22, 2015

Are you getting timeouts loading tiles?
Not sure how this happens, but maybe if loading is aborted and then it finishes loading?

@syork
Copy link

syork commented Mar 11, 2016

I'm getting this same issue. Doing some research leads me to believe it may have something to do with Angular.

@remilev
Copy link

remilev commented Aug 31, 2016

I'm getting this issue too without Angular.

I think that head.removeChild(script) is sometimes executed twice. On second call, script is not in the head anymore and an error is thrown :

window[wk][functionName] = function (data) {
        self._cache[key] = data;
        delete window[wk][functionName];
        head.removeChild(script);
        self._finish_request(key);
    };
    this._queue_request(key, url, function () {
        head.appendChild(script);
        return {
            abort: function () {
                head.removeChild(script); // THIS LINE is executed BEFORE the other removeChild that is executed too. The issue is then ONLY showing when abort is requested.
            }
        };
    });

I'm not sure exactly WHEN ABORT is needed (when timeout occures then tiles were not completly loaded I think), but I'm getting this error when I zoomIn and immediately zoomOut. Not leaving enough time to load tiles correctly (but server serves 200 response code - no timeout problem).

It would probably worth testing if childNode exist before attempting deletion to avoid this error.

@strk
Copy link

strk commented Feb 4, 2017

We're also getting this error from the Windshaft example viewer: https://github.com/CartoDB/Windshaft/tree/master/examples/viewer

@SergioGutTal
Copy link
Contributor

This fixed the problem for me
Change

head.removeChild(script);

for

if (script.parentElement==head) {
  head.removeChild(script);
}

SergioGutTal added a commit to SergioGutTal/Leaflet.utfgrid that referenced this issue Jul 6, 2017
SergioGutTal referenced this issue in SergioGutTal/Leaflet.utfgrid Jul 13, 2017
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

6 participants