The network should only affect whether some js files can be imported correctly, you need to check whether this variable is already defined in the js file that needs to be imported.
I don’t know the context of this code, so the suggestion I could give is if EntityEditorCallback is not defined before, add a statement defining it before this code.
var EntityEditorCallback;
If the response is helpful, please click "Accept Answer" and upvote it.