Recently when working with the regl WebGL wrapper library, I encountered a weird error that I didn’t understand the cause of:
(regl) invalid dynamic attribute "position" in command
I checked my code, and I was indeed passing a position attribute and the data array I was using to construct the buffer looked correct. The error also happened intermittently, happening after my application hot-reloaded.
The Cause
It turns out that I had accidentally created two regl instances and was trying to use buffers allocated on one with commands created on a different one.



