Icon picker doesn't work with bigpipe enabled

Created on 27 October 2023, over 1 year ago

When BigPipe is enabled, the following error is shown in the console. $element.fontIconPicker is not a function
If you disable BigPipe, the picker works.

πŸ› Bug report
Status

Active

Version

2.26

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland mistrae

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

Merge Requests

Comments & Activities

  • Issue created by @mistrae
  • πŸ‡§πŸ‡ͺBelgium wouter waeytens

    I've fixed this the easy way. But the clean way would be creating a new js file, refer the new js file in the libraries.yml and in this new js file wait on the bigpipe and than load the fontawesome.

  • Thank you so much, @wouter-waeytens !!! We recently noticed that our fa-icon-picker widgets weren't working with entity fields, and I struggled for a lot longer than I'd like to admit to figure out why this was happening.

    I have no idea how you figured out that BigPipe was the culprit, but am *very* happy that you did, and that I eventually stumbled across your bug report, and I can report that the patch works perfectly in our Drupal 10 installation.

    A strange aside on this: while existing fontawesome-field entries won't show the icon-picker widget (due to the JS error described above), if your field is configured for unlimited values and you click on the "Add another item" button in the fontawesome-field, the icon-picker widget now works for all instances of the field (and no additional JS errors in the browser console). This is also true when you create a new entity (node, paragraph, etc.), as the JS error seems to be tied to rendering existing values rather than new values. However, this only applies to the current editing session, as you have to do this workaround all over again when you re-edit the entity.

    Needless to say, this pseudo-workaround isn't popular with our users, so having a patch-fix in place is fantastic. Thanks for figuring this out!

  • πŸ‡ΊπŸ‡ΈUnited States jcandan

    For reference: HTML defer Attribute.

  • Status changed to RTBC 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States jcandan

    Confirmed big_pipe enabled on my project. I was getting this $element.fontIconPicker is not a function browser console error. Patch #2 resolved this issue for me.

  • πŸ‡§πŸ‡―Benin delacosta456

    hi
    i also confirm this issue with D10.2.5 php8.2

    Thanks for the patch

  • πŸ‡ΊπŸ‡ΈUnited States ronaldmulero

    Thanks @Wouter Waeytens
    Patch #2 πŸ› Icon picker doesn't work with bigpipe enabled RTBC works for me too.

    • Drupal 10.3.1
    • fontawesome 8.x-2.26
  • First commit to issue fork.
  • πŸ‡¦πŸ‡ΊAustralia VladimirAus Brisbane, Australia

    Added merge request.
    +1 for merge

  • Pipeline finished with Success
    8 days ago
    Total: 170s
    #427074
Production build 0.71.5 2024