I suspect that the issue is…
Pin D3 (GPIO0) is a strapping pin, which puts the board into Flash mode when pulled LOW. When it’s in flash mode it is waiting for a code upload and doesn’t enter run mode.
I’d recommend changing this to a more appropriate pin - see this link for more info…
I’d also suggest using GPIO numbers in your code, rather than “D” numbers.
If you still have issues then try removing all connections from your board, other than the USB connection.
If you still have issues then make sure you aren’t using any Digital datastreams.
Pete.