We’re getting this build error on deploy previews (triggered by Bitbucket PRs), but then when we merge the PR and it triggers a branch deploy it succeeds without any issues.
Last failed deploy preview:
The next build which was triggered by merging that PR and succeeded:
I ended up removing the page query that was problematic. We were filtering WordPress posts by slug to get the /search slug and use that for title and other dynamic UI labelling, but for some reason it never worked with deploy preview builds. So we just ripped it out and we’re hard coding that stuff for now. Still remains a head scratcher.