Problem/Motivation
We have been using this module for some time, and we also have the following line in the "require" section of our composer.json:
"npm-asset/jquery-validation": "^1.19.5",
As recently as 4.6.0 of this module, that line resulted in the jquery-validation package being copied to docroot/libraries during composer install. But when we upgraded to the latest version of this module, 4.10.0, the jquery-validation package was no longer copied to docroot/libraries. This caused javascript errors on our site as the package did not make it into the aggregated javascript files.
Steps to reproduce
I suspect this problem is unique to our site because we have that particular line in our composer.json. But here is a link to a version of the composer.json that has this problem:
https://github.com/usdoj/foia-api/blob/207978184c0d27bf7f7edcf4021872894...
With the above composer.json, the jquery-validation library does not get copied to docroot/libraries. So we had to pin this module to 4.6.0. Here is the pinned version of composer.json in which the problem is fixed:
https://github.com/usdoj/foia-api/blob/fef3b84a543f26b1e2979466c17e487c0...
With this new version of composer.json, the jquery-validation library does get copied to docroot/libraries.
Proposed resolution
This may be a support request, if there is something specific in our composer.json that is causing this. However I wanted to post this in case there might have been an unintended breaking change after 4.6.0. If that is the case, then my proposed solution would be to release 4.11.0 with a revert of whatever that breaking change was.
Remaining tasks
Feedback on whether this is a breaking change or a bug in our site-specific composer.json.
Comments
Comment #2
phenaproximaFirst of all...thank you for the clear and detailed report, and for posting your composer.json. Super helpful. 🙏
I think I see the problem -- you're not requiring
oomphinc/composer-installers-extender, which is the thing that enables support fornpm-assetandbower-assetpackages.This makes sense; that plugin used to be a dependency of Lightning Media, so you would have had no reason to make it a direct dependency. Unfortunately, circumstances forced me to remove it in #3322969: Add an update hook to download required JavaScript libraries, even though it was a breaking change. I tried to put an update path in there to at least cover the libraries that Lightning Media's submodules require to work properly, and documented all of this in the release notes for 8.x-4.7, anticipating that some sites (like yours!) might be using it to install other npm packages: https://www.drupal.org/project/lightning_media/releases/8.x-4.7
That said...looking at the release notes, I maybe could have made it clearer that you need to require the plugin directly if you're installing other npm or Bower packages.
So I think I should go back and edit those before I close this issue.That is now done.I assume you're using Composer 2, since I see you have the
allow-pluginsconfiguration set up properly. I think these commands should -- hopefully! -- get you back on your feet:Let me know if that helps!
Comment #3
brockfanning commentedI finally got around to fixing this, and the
composer require --no-update oomphinc/composer-installers-extender:^2command worked perfectly. Thank you!Comment #5
IngJheyner commentedSirvio muchas gracias.