Console errors when JS aggregation is on

Created on 9 December 2022, over 1 year ago
Updated 19 June 2024, 6 days ago

I get the console error "Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://www.site.ca/node/1/worker-html.js' failed to load." when using JS aggregation.

The ace editor still works, but I cannot do search, etc, in the editor.

Could be related to https://www.drupal.org/project/ace_editor/issues/2090921 β†’

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada jglynn

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ

    Adding a patch for this bug that looks to work for both 1.4.0 and 2.0.0-alpha1 as of 2023-07-05.

    It adds a general setup.js that calls ace.config.set('basePath') to make sure it has the value of the discovered library path from the module.

  • Status changed to Needs review 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ
  • πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ

    A quick update to the previous patch in #3. Currently ace_editor_lib_path doesn't cache its discovered library path so it must run through the filesystem each time it is run. Because the patch adds a hook_page_attachments implementation to populate drupalSettings, it's helpful to cache the path for future use.

    A better solution would be to introduce a service that can be used in both procedural code and the various plugins this module provides but that seems like a bigger refactor that should be tackled separately.

  • πŸ‡ΊπŸ‡ΈUnited States angrytoast Princeton, NJ

    Following up again, here's a slightly different approach that limits the drupalSettings addition by not using hook_page_attachments. Instead it adds them in the respective plugin files so that it's only added when needed, which feels better.

    That said, we only use the filter functionality. I can confirm it works there, but can't confirm for the AceFormatter use case. I'm also not familiar with editor plugins so the base_path isn't added there to drupalSettings and will need more work.

  • Status changed to Needs work 6 days ago
  • πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

    Needs an updated issue fork and MR

Production build 0.69.0 2024