You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure what I am doing wrong, but I had numerous plugins and themes already developed with wpack.io (version 5.x) with no issues. This time however whenever I try to enqueue my ts/scss into the backend nothing shows up. I debugged the issue and possibly solved it.
So far pretty standard. However with the current setup it did not work for me. I debugged it and compared it with other plugins I had developed with wpack.io. The reason seems to be in wpacks main php file: Enqueue.php in the getAssets function
It loads the part of the manifest where the js files are all linked. $enqueue = $manifest['wpackioEp'][ $entryPoint ];
For some reason the manifest looks different for my older plugins vs my current one. And it differs by adding an assets node around the js/css nodes. That way the above code in $enqueue doesn't give any results and nothing is enqueued: wpackioEp:{ reftable: { assets: { js: [....] .... } } }
If in line 297 you change the enqueue variable it seems to work: $enqueue = $manifest['wpackioEp'][ $entryPoint ]['assets'];
Maybe it has something to do with versions and how webpack delivers data. or maybe it is specific to backend. But someone should look at it, why this happens.
The text was updated successfully, but these errors were encountered:
lnilya
changed the title
Strange enqueue behaviour, with nothing being enqueued at all. Needs fix in Enqueue.php source
Strange enqueue behaviour, with nothing being enqueued at all. Needs fix in Enqueue.php:297 source
Jan 7, 2022
With "@wpackio/scripts": "6.4.0" (npm) and "wpackio/enqueue": "2.2" (composer) I get the behaviour described above. So I believe something changed in the web pack config and it doesnt work with the php side anymore, which needs a change as described above. Maybe there is a setting to prevent this "assets" node to be created.
With "@wpackio/scripts": "5.0.0" (npm) and "wpackio/enqueue": "2.2" (composer) everything works fine and as expected.
It's a shame that wpack is not really being supported developed anymore. Was such a great library! : /
With @wpackio/script v6.4.0, you have to use wpackio/enqueue v3.4.0. There has been a change in how manifest json files are generated from the upstream package and the PHP package has been updated accordingly. You can safely upgrade both to the latest version and it should work.
I would appreciate if you'd like to add this to the website documentation.
I am not sure what I am doing wrong, but I had numerous plugins and themes already developed with wpack.io (version 5.x) with no issues. This time however whenever I try to enqueue my ts/scss into the backend nothing shows up. I debugged the issue and possibly solved it.
in my wpproject:
in the plugins main file:
and in the hook to enqueue scripts
So far pretty standard. However with the current setup it did not work for me. I debugged it and compared it with other plugins I had developed with wpack.io. The reason seems to be in wpacks main php file: Enqueue.php in the getAssets function
It loads the part of the manifest where the js files are all linked.
$enqueue = $manifest['wpackioEp'][ $entryPoint ];
For some reason the manifest looks different for my older plugins vs my current one. And it differs by adding an assets node around the js/css nodes. That way the above code in $enqueue doesn't give any results and nothing is enqueued:
wpackioEp:{ reftable: { assets: { js: [....] .... } } }
If in line 297 you change the enqueue variable it seems to work:
$enqueue = $manifest['wpackioEp'][ $entryPoint ]['assets'];
Maybe it has something to do with versions and how webpack delivers data. or maybe it is specific to backend. But someone should look at it, why this happens.
The text was updated successfully, but these errors were encountered: