That particular paragraph is more or less for my own entertainment (and so is the rest of this reply). I don’t really know how they’ve coded it, so I’m just taking a programmer’s stab at how the code could be written to generate that kind of error under those circumstances. I’ll try to explain it in a way that someone with no programming knowledge could understand (because I don’t know how much you know).
From the errors as they are written, it’s pretty clear that the code is trying to access an object which no longer exists. In the guts of the programming, the game must have a list of the various items in the crafting queue. That list is made up of of objects (nodes) that contain their own information, but the only information the list object has is its own name and the location of the first node in the list. Each node knows which object is before it (insertBefore) and after it (insertAfter), it’s own name (id) and at least what type of item is being crafted.
At the most basic level, when the list wants to find an item in the list, it simply goes to the first node, sees if that is the one it wants and if it isn’t, asks that node where the next node is. It repeats that operation until it either finds the item it wants or fails to find it in the last item. It can tell which is the last item because it’s insertAfter property will be empty.
The game takes that list and uses it to draw the icons on the screen in the correct order. So for every frame of graphics the game draws to the screen, it polls the list to see what the order is.
When you hold and drag an item in the queue, the game needs to know where you are trying to put that item so that it can draw the icons in the correct positions. Based on screen position, it knows to put the item in the first, second, third or fourth slot in the visible portion of the list and then figures out which item in the list it needs to insertBefore or insertAfter.
The problem comes when your crafter is puttering away and removes an item from the list at the same time as you are messing with it. When the crafter finishes crafting an individual item, it would remove that item from the front of the list.
But does the code that the program uses to handle moving the position of the held item work directly with that original list? It does and it doesn’t. It is given a pointer to the start of the list. A pointer is simply a variable that tells you where something is. From that, you can find the rest of the list by following the pointer to the next item and then the next all the way to the end.
But what happens when the crafter deletes the first item in the list? The variable that the mouse code uses to tell it where the start of the list is now points at an object that no longer exists! An object that no longer exists is said to be null. The first time the mouse code knows about it is when it tries to get the name (id) of the first item on the list. It fails to find the name and generates an error report: “Cannot read property ‘id’ of null”. The traceback tells us (through the magic of informative function names!) that this happens when trying to draw the crafting window on the screen (show_workshop.js) and that is handled by a series of specific functions in the jquery-ui code.
Now, if you were only dragging your mouse to a position after the first item in the list, that’s all you’d see. But when you are in the first position, you get a pair of errors that duplicate each other. Again, I can only guess based on the errors given and the way lists usually work.
Usually, if you want to put a new item in a list it is called an insert. You have one function for inserting before a specified item and one for inserting after a specified item. If we want to insert an item before an existing item, we need to know which item previously came before that existing item (so we can tell it who the new “next” item is). The error we see is for failing to read the property ‘insertBefore’, so we can assume that an insert before is indeed occuring.
Just like the first error, the problem is that we are trying to do something with an item/object/node that no longer exists. In this case, we get the first two errors as the game tries to construct some list of items to draw to the screen. It’s doing something that requires it to know the property insertBefore of that deleted node and thus fails. The traceback lets us know that this something has to do with rearranging (_rearrange) something (presumably the crafting queue), while dragging the mouse (_mouseDrag), which is handled by generic code for moving the mouse(_mouseMove) and so on down the line.
I really can’t guess why it throws out that same error twice other than to state the obvious: It needs to find the same information twice. Based on the tracebacks, it probably attempts to get that information in two different lines of the same piece of code, but that’s all we can see.
I hope that makes my guesswork somewhat more clear than mud and again, it is just guesswork. Whoever squishes this bug will be more than capable of figuring out the truth for themselves, because they’ll have actual code to look at.