Texture as data in shader has odd behavior

Any idea why i get an error that say: cant find variable nearest ? Using the same code in my computer. It works fine in p5.editor