How to wait for another script to finish the correct way?

A post was merged into an existing topic: How to call scripts only for a loaded template using fetch JS