i'm new too but the imgui::end should be outside not inside.
like this:
ImGui::SetNextWindowSize(ImVec2(300, size.y + 40.f));
if (ImGui::Begin("Spectator List", NULL, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse))
{
ImGui::Text(spectators.c_str());
}...