It's also very clear when it says that states can't enter into any compact without Congressional approval. Article 1, Section 10, Clause 3 is known as the Compact Clause and states:
No State shall, without the Consent of Congress, lay any Duty of Tonnage, keep Troops, or Ships of War in time of Peace, enter into any Agreement or Compact with another State, or with a foreign Power, or engage in War, unless actually invaded, or in such imminent Danger as will not admit of delay.
In Virginia v. Tennessee (1893) the Supreme Court specified that Congressional approval would be needed if the agreement is "directed to the formation of any combination tending to the increase of political power in the States, which may encroach upon or interfere with the just supremacy of the United States."
And that would probably apply here because it's undermining the way the Electoral College was intended to work.
But you are also correct that states are free to appoint their electors as they see fit, so it's quite the conundrum.
My assumption as a layman is that any official document or compact would be thrown out so there wouldn't be anything on the books about a popular vote compact. States would probably still be free to individually appoint their electors to the winner of the popular vote, but then there also wouldn't be anything holding them to that standard either.