Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: The specifier “@wordpress/interactivity” Relative module specifiers must start with “./”, “../” or “/” #63221

Open
rosa2 opened this issue Jul 7, 2024 · 1 comment
Labels
[Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.

Comments

@rosa2
Copy link

rosa2 commented Jul 7, 2024

Description

Hello and thanks for all your work in WordPress

I use Dokan-lite that allows to have a multivendor site. When I edit as a vendor a product I get this error:

Uncaught TypeError: The specifier “@wordpress/interactivity” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

I searched and found little about it and one that gave to me the solution:

Firefox es seems to have trouble with "@wordpress/interactivity" in the file “wp-includes/blocks/navigation/view.min.js” – it returns that same Uncaught TypeError.

If I change the beginning of that file from

import*as e from"@wordpress/interactivity"

to

import*as e from"/wp-includes/js/dist/interactivity.min.js"

They say that it happens with Firefox, but I have that problem also with Chromium version 108.0.5359.40 (Developer Build) Ubuntu 22.04 (64-bit). My Firefox version 127.0.2 (64 bits).

I have made the proposed solution, and the error has gone, but, of course, when I update WordPress, I would have to make it again if it is not changed.

I can't test it only with Guttemberg because the error comes with Dokan-lite, but other users report with other modules that use interactivity.

https://wordpress.org/support/topic/auto-prefetch-urls-on-mouse-hover-not-working-with-wp-6-5-interactivity-api/
https://wordpress.org/support/topic/wordpress-navigation-overlay-menu-not-working-with-firefox-115/
https://wordpress.org/support/topic/when-the-plugin-is-activated-the-default-lightbox-feature-stops-working/
https://mytory.net/archives/15766
https://wordpress.org/support/topic/console-error-with-gutenberg-plug-in/

Thanks again for your great work :)

Step-by-step reproduction instructions

  1. Install WordPress 6.5.5 and Dokan-lite 3.11.3
  2. Create a user with role vendor
  3. Create a product with that user
  4. The error appears in both browsers developer console

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.5.5 and Dokan-lite 3.11.3
  • Ubuntu 22.04 (64-bit)
  • Chromium version 108.0.5359.40 (Developer Build) and Firefox version 127.0.2 (64 bits).
  • Twenty Twenty Four 1.1 subtheme

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

Yes

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

Yes

@rosa2 rosa2 added the [Type] Bug An existing feature does not function as intended label Jul 7, 2024
@cbravobernal cbravobernal added the [Packages] Interactivity /packages/interactivity label Jul 7, 2024
@cbravobernal
Copy link
Contributor

Hi @rosa2 !

It seems to be an issue related to how the plugin is loading the assets. Interactivity API is a script module, and some plugins must update how they load JS assets.

https://make.wordpress.org/core/2024/03/04/script-modules-in-6-5/
https://core.trac.wordpress.org/ticket/61500

While we are working on improve modules interoperability, we recommend to contact to the plugin developers so they can handle how to load script modules.

@cbravobernal cbravobernal added [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. and removed [Packages] Interactivity /packages/interactivity [Type] Bug An existing feature does not function as intended labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
None yet
Development

No branches or pull requests

2 participants