Well, your code works fine on my Uno… The only thing that can be happening is that you haven’t selected the right board on uploading…
Now, when I switch back to my Uno, it’s actually not on the right COM until I select the COM that has my board.
Now, both are selected properly.
Then, Upload.
Works great.
If you’re having issues still. Either, a) look around on the internet for issues with the board type you’re using, b) get a different board type and see what happens, c) contact the XOD developers to report a possible bug (only after you’ve done a) and b) ). If you’re using Wi-Fi… Then, if you’re not married to arduino then you may consider ESP32.
You gotta have the Packages up-to-date, too… Check out this post, they mention selecting a particular board.