KNOWN BUG: If you mine the invisible miner before you mine the inserter, then try rotating that inserter, the game will throw up an non-recoverable error. I have no idea how to fix that, any and all advice is welcome!
that was because entity store in global.inserter_do_mining.watching_drill no longer in the vailid state,so you should add a simple detection in the beginning of when_on_destory() and when_on_rotate()