Pheatmap Error in[1L], rx[2L], length.out = nb)

Solution for Pheatmap Error in[1L], rx[2L], length.out = nb)
is Given Below:

I’m getting an error every time I try to use pheatmap:

Error in[1L], rx[2L], length.out = nb) : 
  'from' must be a finite number
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf

It used to work just fine on my computer and I have run this code plenty of times, with different data

         main=paste(runName,"Methylation Ratio"), 
         fontsize_col=colFontSize, fontsize = fontSize,
         show_rownames = T, 
         annotation_col = sampleStats, 
         annotation_row = fragInfo, 
         na_col = "snow4", 
         annotation_colors = my_ann_colors)

I’m not sure why I keep getting this error and I need some help.