hiletgo esp8266 does not serial print in setup() but does in loop()

The following code does not print anything to the serial monitor but if I move the println to loop then it will print. I get the same result when running the esp8266 example sketches.

Any ideas?

#include "ESP8266WiFi.h"

void setup() {
  Serial.begin(115200);
  Serial.println(WiFi.macAddress());
}

void loop(){
  
}

Have you tried using delay() to wait a little while before printing in setup()? There is a lot of background stuff that has to happen before the WiFi is available so a lot of the sketches have a delay at the start.