S2 images showing NaN in SNAP

I had the same problem Annelies encountered (S2 image with all NaN bands) but after a lot of trial-and-error I discovered that the problem was a space in the file path of the S2 image. After fixing that everything worked fine.