Invalid definition file of shader

Why i can’t import this shader to Codea?
obj.material = craft.material("Documents:Portal")
After that the error appears:
Main:24: Shader could not be loaded (definition file invalid) - Documents:Portal stack traceback: [C]: in field 'material' Main:24: in function 'setup'

link to shader:
https://www.icloud.com/iclouddrive/0aq0SbS9OBeZlHLoNcFyDyaSA#Portal

@Picalines - had trouble saving the file to my Codea folder , but once there ran ok. Photo with use in a cube. The file was saved to my iCloud Drive and seemed not to want to transfer to my Codea folder.

Later I tried adding a zero number node and saving again - if you struggle you might try that.

What versions of Shade and Codea are you using and what device and iOS?

Does sharing files automatically save to iCloud?

@Picalines I also just loaded you Portal Shade and it worked fine using my code in the discussion Shade to Codea.

I uploaded this shader to icloud just for demonstration. I am using latest versions of iOS, Codea and Shade

I tested shader using Shade to Codea discussion and it didn’t work as well. Rebooting the device (iPad Air 2) and editing the shader doesn’t help either.

@Picalines - have you used the fileapp to ensure you have a copy of the Portal.shader in your Codea Documents folder - that’s where I ran it from on my iPad. Tend not to use iCloud.

Originally i created shader in “On iPad” → “Codea” folder using files app

@Picalines - so you have verified the shader is in the Codea folder. When you tap on the craft.material() input

obj.material = craft.material("Documents:Portal")

can you see the file in the selection window? you have to close Codea and restart it to see these files in the dialog window. Codea creates an asset list when it is started.

Okay, I see what the problem is. Somehow I was able to create a Shader called Portal, although I already had an image with the same name in my folder. Apparently Codea tried to use sprite instead of Shader. I think it is a bug of files app, but who knows. Now all works fine

Anyway, thanks for help

@Picalines that is a bug in Codea, thank you for discovering it