- Issue created by @steven buteneers
- First commit to issue fork.
- 🇪🇪Estonia mikkmiggur
I got the same error when the content was in the Korean language.
Uncaught DOMException: Failed to execute 'remove' on 'DOMTokenList': The token provided ('알 수 없음') contains HTML space characters, which are not valid in tokens.
- 🇪🇪Estonia mikkmiggur
Issue is coming from the yoast_seo.js file line 305
// We convert the label to lowercase here, which is not as good as clean_css that's being called on the back-end, // but is good enough for the constraints on the classes we use. scoreDisplay.classList.remove(scoreLabel.innerHTML.toLowerCase());
Content of scoreDisplay.innerHTML is:
<span class="score_circle"></span> <span class="score_value">알 수 없음</span>
- 🇪🇪Estonia mikkmiggur
That issue is coming from Drupal translation.
When I change that field back to English then there is no issue. - 🇪🇪Estonia mikkmiggur
overall_score.html.twig file contain
<div {% if overall_score_target_id %}id="{{ overall_score_target_id }}"{% endif %} class="overallScore {{ overall_score|clean_class }}"> <span class="score_circle"></span> <span class="score_value">{{ overall_score }}</span> </div>
When I remove that "clean_class" from here then I don't have that issue anymore.
When we add "clean_class" and later try to update the value and use "overall_score" as an indicator then these 2 values can not match in some cases. - 🇮🇳India dharmendraqed42
I got an error that said, 'Uncaught DOMException: Failed to execute 'remove' on 'DOMTokenList': The token provided ('not available') contains HTML space characters, which are not valid in tokens.'
I fixed it by changing this part of the code in yoast_seo.js file:
Before:
scoreDisplay.classList.remove(scoreLabel.innerHTML.toLowerCase());
scoreDisplay.classList.add(newLabelText.toLowerCase());After:
scoreDisplay.classList.remove(scoreLabel.innerHTML.toLowerCase().replace(' ', '-'));
scoreDisplay.classList.add(newLabelText.toLowerCase().replace(' ', '-'));This change fixed the problem.
- First commit to issue fork.
- last update
about 1 year ago Composer require-dev failure - @lendude opened merge request.
- 🇳🇱Netherlands Lendude Amsterdam
The change needed to be done in both the remove and the add commands to really get rid of the issue, pushed changes to the MR
- 🇳🇱Netherlands Johan den Hollander
The changes in the MR work well for me.
- Status changed to Needs review
about 1 year ago 3:09pm 15 November 2023 - last update
about 1 year ago Composer require-dev failure - Status changed to RTBC
about 1 year ago 10:11am 23 November 2023 - 🇧🇪Belgium tim-diels Belgium 🇧🇪
I got the same error and the MR fixed it for me.
- 🇳🇱Netherlands watergate
Although already marked as RTBC, I can confirm it resolves our problem as well.
- 🇫🇷France Grimreaper France 🇫🇷
Hi,
I have tested patch from comment 7 which is currently the same change as the MR and I too confirm it fixes the bug.
Thanks for the fix!
- 🇮🇳India arunkumark Coimbatore
Reviewed patch #7, applied successfully, and resolved the issue. +RTBC
Before Patch
After Patch
- Merge request !30Issue #2755181 by Andriy Khomych, ozin: Update js with the latest version of... → (Open) created by arunkumark
- 🇮🇳India arunkumark Coimbatore
arunkumark → changed the visibility of the branch 3394487-uncaught-domexception-failed to hidden.
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
6 months ago Waiting for branch to pass - Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
6 months ago Waiting for branch to pass