TypeError: Cannot read properties of null (reading 'active') is not a helpful way for Deploy > Pages to tell you that a project has no live site. It is what the live block did, though, once the only primary deployment had been stopped. The query returned no active primary deployment. The parent passed null. The child read deployment.active anyway.
This is the story of gitlab-org/gitlab!274390, a one-condition render fix, and a reminder that a Vue prop default is not a null guard.
The issue: a block that assumed a deployment existed
The issue was gitlab-org/gitlab#642598, opened by Miguel Rincon. On Deploy > Pages, a project that still has Pages enabled but no active primary deployment — for example after its only deployment was stopped — blew up in the live block.
deployments.vue passed newestDeployment into live-block. That computed value is null when the query has no active primary deployment. live-block still rendered once loading finished, and it read deployment.active. A prop default does not run when the parent passes null. null is an explicit value. The default only applies when the prop is omitted or undefined.
The rest of the page was fine. The deployments list already has a "No deployments yet" state. The live block was the part that assumed there was something to show.
The fix: do not mount the block when there is nothing live
The production change is a v-if on the live block, not a defensive ?. inside it:
<live-block v-if="newestDeployment || $apollo.loading" :is-loading="!newestDeployment && $apollo.loading" :deployment="newestDeployment" /> While the deployments query is in flight, the block still mounts in its loading state, even if newestDeployment is still null. Once loading has finished and there is no active primary deployment, the block is not rendered at all. A later active deployment brings it back.
That is narrower than making live-block itself tolerant of null. The parent is the one that knows whether a primary deployment exists. The child can keep assuming that, when it is mounted after load, it has a deployment.
Specs for the empty path, and real screenshots
The existing examples always used a query with an active primary deployment, so they never reached the crash. The new context feeds the component an empty pagesDeployments connection.
While that query is still pending, the live block is mounted with isLoading: true and deployment: null. After the promise resolves, the live block is gone, and the page still shows "No deployments yet". A happy-path example now also checks that the live block receives the newest primary deployment.
This is a UI change, even though it is a conditional one. Miguel and Asherah Connor both asked for real before and after screenshots of the no-active-deployment state, not a written table. Those screenshots went into the MR description, taken from the broken commit and from the fix, and Miguel confirmed the TypeError was gone in GDK: a project with an active parallel deployment and no active primary deployment loaded cleanly.
What I took away
1. A Vue prop default is not a null check. null is a value the parent passed on purpose. If a child reads deployment.active, the parent has to stop mounting it, or the child has to test for null. The default will not save you.
2. Keep the loading state visible. Hiding the block whenever newestDeployment is null would also hide it during the first fetch. v-if="newestDeployment || $apollo.loading" is the difference between "not yet loaded" and "loaded, and there is nothing live."
3. The existing happy-path examples will not catch this. They already had a deployment. The new examples had to start from an empty connection.
4. Conditional UI still needs screenshots. Reviewers will send the MR back if the Before/After table is only prose. Take the broken state and the fixed state, and put them in the description when you open the MR, not after the second nudge.
The MR merged on 27 November 2026.
Links
- Issue: gitlab-org/gitlab#642598
- Merge request: gitlab-org/gitlab!274390
Thanks to Miguel Rincon for the issue, the GDK check, and the review, and to Asherah Connor for insisting on real screenshots and for the group approval.
If you've been thinking about contributing to GitLab, the community issues are a great place to start: contributors.gitlab.com.
