[wp-trac] [WordPress Trac] #61387: Interactivity API: not working in classic theme

WordPress Trac noreply at wordpress.org
Thu Jun 6 10:07:57 UTC 2024


#61387: Interactivity API: not working in classic theme
-------------------------------+-------------------------
 Reporter:  swissspidy         |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Interactivity API  |     Version:  6.5
 Severity:  normal             |  Resolution:  worksforme
 Keywords:                     |     Focuses:
-------------------------------+-------------------------
Changes (by swissspidy):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Yes that's the error message.

 > but it's working in some themes because parts of the theme add this
 module dependency

 Yes I assume that's the case.

 > How is it being built? Is `@wordpress/interactivity` listed as a
 dependency in its asset file or where it's enqueued?

 I simply followed [https://make.wordpress.org/core/2024/03/04
 /interactivity-api-dev-note/ the dev-note] and added `"viewScriptModule":
 "file:./view.js"` to my `block.json` file. My `view.js` script is pretty
 simple and there is no build step involved.

 So are you saying I need a build step to create an `.asset.php` file so
 that `@wordpress/interactivity` gets listed as a dependency?

 I see. I thought this was added automatically.

 Well, my bad.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61387#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list