Hi @LorRrR and welcome,
Can you elaborate on how exactly are you structuring your code and shader?
In general if you are looking to leverage lighting/shadows then you should avoid writing a custom shader but instead use shader chunks (override part of the internal PlayCanvas rendering code). Example project:
I just copied shader project files into my project, but this error appears, and disappears when I turn off cast shadow either on render component or light comp.
As I said, you can’t use a custom shaders with PlayCanvas lighting/shadows. You need to use shader chunks for that.