You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mozilla TypeError: mutating the [[Prototype]] of an object will cause your code to run very slowly #1805
I'm working on Mozilla Aurora v 30.0a2 and I noticed this Warning today appearing in both Firefox Dev tools and Firebug.
"TypeError: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create"
I've switched to Chrome and there was no such warning in the console.
At any rate, this is a fairly aggressive warning given that changing the prototype is effectively the only good way to create an array subclass in ES5. When ES6 is available and Array.create is supported, I will happily switch to that rather than reassigning the prototype, but in the meantime there’s no better solution and the above warning is not helpful (and in fact misleading because Object.create is not applicable for arrays).
Same problem. I just installed Firefox 30.0
TypeError: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
I've been hitting this error as of just this morning now. FF 30.0, no Firebug, even when every plugin is disabled on a clean install. I'm only using Mozilla's built-in debugger, and it seems to be working, but needless to say, I'd love to have it go away. Is it hopeless?
It’s important to notice that this is a warning, not an error (it goes away if you hide warnings in the console). I think part of the panic is caused by the word “TypeError”. There is sufficient explanation in this issue for why it’s not a problem, and we have no good alternative until Array.create is supported.
(Others have run into problems, but this seems related to an older version of Firebug—perhaps some incompatibility causes warnings to be treated as errors, I’m not sure.)
@PaulBrinkley - it occurred on two machines - it appears to be an issue with the FF 30 update - when we did a full reinstall, the error did not reoccur - the existence of the TypeError warning could simply be a coincidence and not the cause.
The culprit appears to be d3_subclass from core/subclass.js; since that code is itself a patch / hack, I'm not really sure what sort of resolution to expect- again, just trying to add some context.
In the interest of following up, I concur with JasonDavies - I'm still getting this "error" 3 weeks later, and it indeed does NOT appear to impede my development - things are going well enough despite it. (It's certainly not good to get it when you're new to d3 and trying to diagnose another mysterious problem, but at least it's a known warning and this thread is around to explain it.)
Activity
mbostock commentedon Mar 23, 2014
I don’t see this error in 30.0a2 (2014-03-23) when visiting http://d3js.org.
At any rate, this is a fairly aggressive warning given that changing the prototype is effectively the only good way to create an array subclass in ES5. When ES6 is available and Array.create is supported, I will happily switch to that rather than reassigning the prototype, but in the meantime there’s no better solution and the above warning is not helpful (and in fact misleading because Object.create is not applicable for arrays).
Solidary commentedon Jun 6, 2014
Same problem. I just installed Firefox 30.0
TypeError: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
boldt commentedon Jun 12, 2014
I just got my Firefox 30.0 update; I can't debug my code any more, because the debugger hangs at this warning. Any suggestions?
jasondavies commentedon Jun 12, 2014
It’s just a warning that appears in the console as far as I can tell. Are you sure it prevents you from debugging your code?
boldt commentedon Jun 12, 2014
I am loading d3 with require.js, which throws the following error:
Even if I click on continue immediately; I am not reaching my code at all.
[EDIT] The debugger stopps at this warning.
jasondavies commentedon Jun 12, 2014
Works for me. Do you have a reproducible example?
boldt commentedon Jun 12, 2014
I just restarted my firefox. It seems, that I also got a Firebug update. At least Firebug looks a bit different now. And: it works.
[EDIT] I have Firebug 2.0 now. Probably the bug occured with Firebug 1.12.
Paul-Brady commentedon Jun 13, 2014
I am using D3 with ThreeJS to produce two simultaneous 3D representations similar to what Steven Hall did here: http://projects.delimited.io/experiments/d3-threejs/slow-device.html. On a particular machine using Ubuntu 13.04 and FireFox 30, the TypeError that @blankdots got is occurring and preventing the elements in the scenes from being transformed to their 3D positions. It works with Chrome. Cannot get to the bottom of it. Any thoughts?
jasondavies commentedon Jun 13, 2014
Without a reproducible example, I can’t really help, sorry. Are you running an older version of Firebug?
Paul-Brady commentedon Jun 13, 2014
@jasondavies Thanks for the prompt response. Firebug is up to date. I will try to recreate it in an example.
Paul-Brady commentedon Jun 13, 2014
@jasondavies this example generates the TypeError: https://github.com/Paul-Brady/TypeErrorDemo
jasondavies commentedon Jun 13, 2014
It works fine for me with Firefox 30.0/Ubuntu 13.04 (clean install; no addons). Perhaps you should try disabling addons.
jasondavies commentedon Jun 13, 2014
I installed Firebug 2.0 and everything still works.
Paul-Brady commentedon Jun 13, 2014
A full reinstall worked. Very strange. Many thanks for looking into it.
PaulBrinkley commentedon Jun 25, 2014
I've been hitting this error as of just this morning now. FF 30.0, no Firebug, even when every plugin is disabled on a clean install. I'm only using Mozilla's built-in debugger, and it seems to be working, but needless to say, I'd love to have it go away. Is it hopeless?
jasondavies commentedon Jun 25, 2014
It’s important to notice that this is a warning, not an error (it goes away if you hide warnings in the console). I think part of the panic is caused by the word “TypeError”. There is sufficient explanation in this issue for why it’s not a problem, and we have no good alternative until Array.create is supported.
(Others have run into problems, but this seems related to an older version of Firebug—perhaps some incompatibility causes warnings to be treated as errors, I’m not sure.)
Paul-Brady commentedon Jun 25, 2014
@PaulBrinkley - it occurred on two machines - it appears to be an issue with the FF 30 update - when we did a full reinstall, the error did not reoccur - the existence of the TypeError warning could simply be a coincidence and not the cause.
dzdrazil commentedon Jul 16, 2014
I realize this is closed, but this post on Bugzilla adds some new context to the error, and it also explains where it's coming from:
https://bugzilla.mozilla.org/show_bug.cgi?id=984146
The culprit appears to be d3_subclass from core/subclass.js; since that code is itself a patch / hack, I'm not really sure what sort of resolution to expect- again, just trying to add some context.
PaulBrinkley commentedon Jul 16, 2014
Appreciate the update.
In the interest of following up, I concur with JasonDavies - I'm still getting this "error" 3 weeks later, and it indeed does NOT appear to impede my development - things are going well enough despite it. (It's certainly not good to get it when you're new to d3 and trying to diagnose another mysterious problem, but at least it's a known warning and this thread is around to explain it.)
fmarier commentedon Oct 22, 2014
Out of curiosity, what change would you make if you could make use of ES6?
I'm asking because I'm using D3 within the Lightbeam add-on and I could carry a small ES6-only patch in that environment.
mbostock commentedon Jan 12, 2015
ES6 supports extending arrays using the class syntax (
class d3_Selection extends Array), so we’ll be able to use that instead of reassigning proto.crxgames commentedon Jan 29, 2015
Can confirm this on Firefox 35.0 fresh install without plugins and with firebug/web developer toolbar.
kornelski commentedon Feb 21, 2015
Firefox 38.0a1 complains about:
leninmehedy commentedon Jan 8, 2016
Firefox38.5.2 complains about:
mbostock commentedon Jan 8, 2016
In D3 4.0, d3-selection no longer uses array subclassing, so there’s no Prototype modification warning.
r0b- commentedon Feb 13, 2016
Is there a chance to get a fix for version 3.x?
mbostock commentedon Feb 13, 2016
No, sorry.
gabrielrtakeda commentedon Apr 11, 2016
Same with Firefox 45.0.2

shapovalovts commentedon Apr 17, 2016
The same in FF 45.0.1.