Why in the same project 1 bundle.js file works fine with 1 HTML page but throws an error in another HTML page?

I am trying to create a card game using firestore data base. So i have 1 script.js file which i bundled into 1 bundle.js file and also have 2 HTML files, one for main lobby and one for players table. So html page with lobby works fine, but html with table throws errors one after another like whole code would be incorrect. It says something about bundle.js but i dont understand what the problem is. Please help.text

I dont know what to do.