Yes, that is expected. As document, ensureSyntaxTree will only return a tree if it was able to finish parsing up to the position you gave it. state.tree (or rather syntaxTree(state)) will always have a tree, but if the state is behind on parsing, that may not cover the entire document.
hi sorry for late reply.
I tried to reproduce but the thing works fine on code sandbox
And the setup i use has layers upon layers of company package it’s really hard to give better debugging information.
But upon debugging i’ve found in case of the correct scenario i’m getting this as fields data