MKR WiFi 1010 always returns WL_NO_SHIELD

For anyone having the same problem.

Make sure you have the right board selected under Tools -> Board. I had MKR WiFi 1010, while in fact the board is MKR1000 (I didn't realize the bundle I got had the previous gen board in it).

"Get Board Info" doesn't actually contact the board, and returns whatever you have selected for the Board option, which added to confusion.

It sounds like you may have selected an example from a different library.
Make sure you are using the ones for the MKR1000 and not any other boards.

As ballscrewbob said,

they are using different library

1000 ---> WiFi101.h
1010 ---> WiFiNINA.h