"RenderPass cannot be started while inside another render pass" issue

Hi folks!
I’ve been using the water reflection from this snippet of the after the flood - you can see just the reflection in action here:

It used to work just fine but with some PlayCanvas engine updates, some errors started to pop up:

The second error is an easy fix, just gotta check a box on the camera, but the first one (RenderPass cannot be started while inside another render pass) is hard to ascertain what can be done to fix.

With my own digging, the crux of it seems to be the “Water Reflection Outer Glass” rendering layer as the error persists until that is removed from the camera but doing so breaks the water effect. Changing the ordering of the render layers in the render settings both did nothing to remove the error and/or broke the effect too. So it’s gotta be within the scripting of the water script - probably around lines 337-378, based on my limited understanding.
Might also be related to this warning about deprecated syntax that also pops up on the console:
“debug.js:26 DEPRECATED: pc.Layer#renderTarget is deprecated. Set the render target on the camera instead.”

But that’s about as far as my current knowledge gets me. Anyone else has
A - Any ideas of how to fix this error
B - An example of water shader with reflections that has no errors that I could replace this one with.

Yeah it is related to that deprecated warning. Note that all should still work fine on WebGL, but won’t work on WebGPU.

The owner of that script would ideally fix it to not assign render targets to a layer, but only on a camera.

Also note that this is only an error when using debug version of the engine.

Ah perfect. Thanks for the explanation. Also the fact it only happens on the debug version of the engine is something I had totally missed, thanks for that too