drupalSettings.ajaxTrustedUrl sometimes undefined

Created on 9 August 2023, 11 months ago
Updated 14 August 2023, 11 months ago

Problem/Motivation

In some scenarios, BigPipe causes ajax errors where drupalSettings.ajaxTrustedUrl is undefined at https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/misc/ajax.j...

Uncaught TypeError: Cannot read properties of undefined (reading '') at new Drupal.Ajax

Steps to reproduce

This is a strange one - we have observed this on a search API page, with facet blocks

For some search terms, the facet blocks do not appear, and the JavaScript error appears in the console.
For other terms, the page loads as expected, with no errors in the console. In that scenario, drupalSettings.ajaxTrustedUrl is populated with the current page URL.

With the BigPipe module disabled, the error does not occur.

Other modules enabled which may be relevant:

* better_exposed_filters
* facets
* search_api_autocomplets
* views_ajax_history

TODO: check whether the issue is actually caused by one of these modules, or by custom code

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

10.1 ✨

Component
BigPipeΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom malcomio

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

Comments & Activities

Production build 0.69.0 2024