WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.32k stars 4.12k forks source link

ES Modules enqueued during enqueue_block_assets are not loaded in the framed editor #64482

Open SeanMcMillan opened 1 month ago

SeanMcMillan commented 1 month ago

Description

I recently changed a site that uses ES Modules to use wp_enqueue_script_module for them. This worked fine on the front end, and in the admin, and in the post editor, but the module is not loaded in the site editor.

Step-by-step reproduction instructions

  1. Enqueue a module during enqueue_block_assets. Hopefully one with a side effect you can see
  2. Edit the site in the site editor
  3. Notice that the module has not loaded or executed in the content frame.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.6

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

SeanMcMillan commented 1 month ago

Could be that _wp_get_iframed_editor_assets doesn't process script modules. But I'm terrible at navigating the source repositories to find things like that, so take it with a grain of salt.