once error: Selector must not be empty

Created on 27 December 2023, 6 months ago

Problem/Motivation

On a page of my D10 site where an insight is supposed to appear, I get this error in my console:

Uncaught TypeError: Selector must not be empty

being thrown by once.

It stems from this call in insights.js:

once('qualtricsxm_insights:'+id)

That was recently part of a D10 compatibility issue (https://git.drupalcode.org/project/qualtricsxm/-/commit/b3dae6a5da7b95d0...) but the new syntax is buggy.

Steps to reproduce

Go to a page with an insight.

Proposed resolution

The original code is this:

$(document).once('qualtricsxm_insights:'+id).each(function () {//the thing}

Per the once CR β†’ the new syntax would be:

if (once('qualtricsxm_insights:'+id, 'html').length) {//the thing}

Remaining tasks

Do it

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

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

Comments & Activities

Production build 0.69.0 2024