The changeFilter function gets tr.state exception

Hi,marijn
I wrote the Mod-h shortcut key and executed it, replacing the code in the selected area

I perform some operations in changeFilter and get tr.state to report an error.

At present, I can’t reproduce the error in codesanbox, but the same code in my local area reports an error
image

codesanbox:

can you give me some advice?

Upgraded @codemirror/view to 6.10.0, fixed the issue。share with others