I was able to fix this for now by just hardcoding a dungeon layout. I think it may have just been a memory issue. I will do some tests today to see if I can get the procedural generation to work in browser.