Call to a member function getCacheContexts() on null

Created on 30 July 2025, 3 days ago

Problem/Motivation

In our project we have a headless NextJS project fetching data from Drupal.
When not using custom_field everything works fine.
After adding a custom field we get this 500 error:
```Call to a member function getCacheContexts() on null```

Steps to reproduce

This was only reproducible using a headless site with NextJS. In Drupal the node is loading fine.
Add a custom_field with long text to a node.
Add anything in the field and save the node.
Try loading the page in the headless site.

Proposed resolution

Check if the field has the `processed` property when trying to get cache information.

πŸ› Bug report
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom unqunq

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024