Can not install drupal/iframe_resizer 2.0.4:

 Problem 1
    - Root composer.json requires drupal/iframe_resizer ^2.0 -> satisfiable by drupal/iframe_resizer[2.0.4].
    - drupal/iframe_resizer 2.0.4 <strong>requires bower-asset/iframe-resizer ^4.2 -> could not be found in any version, there may be a typo in the package name.</strong>

How can we solve this?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drupalfan2 created an issue. See original summary.

niharika.s’s picture

Assigned: Unassigned » niharika.s
niharika.s’s picture

I have successfully installed the drupal/iframe_resizer package 2.0.4 version, and it should now support our project requirements. If there are any changes needed or further updates required, please review and let me know.

niharika.s’s picture

Assigned: niharika.s » Unassigned
Status: Active » Needs review
drupalfan2’s picture

composer require "drupal/iframe_resizer:2.0.4"

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/iframe_resizer 2.0.4 -> satisfiable by drupal/iframe_resizer[2.0.4].
    - drupal/iframe_resizer 2.0.4 requires bower-asset/iframe-resizer ^4.2 -> could not be found in any version, there may be a typo in the package name.
drupalfan2’s picture

Priority: Normal » Major
anybody’s picture

Version: 2.0.4 » 2.x-dev
Component: Code » Documentation
Assigned: Unassigned » grevil
Priority: Major » Normal
Status: Needs review » Needs work

Documentation should be added to the frontpage and README.md how to install the dependency using asset-packagist and instead of require we should just suggest the bower-asset? As an alternative to manual installation.

Please note that npm-asset has a different folder structure! So we should keep bower-asset. On the other hand the version ends with ^4 there while ^5 is latest. That should maybe be a follow-up?

logeshvaran’s picture

Hi,

I added the code below to composer.json, and the bower-asset package was downloaded successfully when I ran the composer require drupal/iframe_resizer command.

"repositories": [

{
"type": "composer",
"url": "https://asset-packagist.org"
}
]

Kindly try this if you encounter this issue.

grevil’s picture

Yea sorry, not very best practice to directly require a library where an external repository has to be added first...

I'll adjust it accordingly, thanks.

grevil’s picture

Assigned: grevil » Unassigned
Status: Needs work » Needs review

All done, should be clearer now.

grevil’s picture

Title: bower-asset/iframe-resizer -> could not be found in any version » Properly document js library requirement and fix automatic composer requiring
anybody’s picture

Status: Needs review » Reviewed & tested by the community

Well done @grevil!

  • anybody committed 7b24b97e on 2.x authored by grevil
    feat: #3489850 Properly document js library requirement and fix...
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sirclickalot’s picture

I have be using the IFrame Resizer module now for a number of years now.

I am have just updated my site with...

composer require "drupal/iframe_resizer:^2.0"

... and this happened....

./composer.json has been updated
Running composer update drupal/iframe_resizer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 1 removal
  - Removing bower-asset/iframe-resizer (v4.3.5)
  - Upgrading drupal/iframe_resizer (2.0.4 => 2.0.5)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 1 removal
  - Downloading drupal/iframe_resizer (2.0.5)
  - Removing bower-asset/iframe-resizer (v4.3.5)
  - Upgrading drupal/iframe_resizer (2.0.4 => 2.0.5): Extracting archive
 0/2 [>---------------------------]   Deleting libraries/iframe-resizer - deleted

The library go deleted!

I'd appreciate anyone's insights here!

Thank you

Double checking

I have fully uninstalled the module, removed the package using composer, cleared composer caches, and reinstalled using composer from scratch but no JS brought it.

Clarification

For clarity, the repositories section of my composer.json is ...

  "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    ],

Other modules that require libraries from either perform as expected and bring down / update their assets libraries, for example (from my composer.json...

    "require": {
        "bower-asset/mmenu": "^8.5",
        "bower-asset/sticky": "^1.0",
        "npm-asset/lazysizes": "^5.3",
        "npm-asset/select2": "^4.1.0-rc.0",
        "npm-asset/superfish": "^1.7",
...

And I note that the last four lines of the composer.json of the module itself contains...

  "suggest": {
    "bower-asset/iframe-resizer": "Required for this module to work. Please require version ^4. 5.x is not supported."
  }
}

So I am expecting:

  1. The library to be updated if needed.
  2. The library to be installed on a fresh module install.

The config section of my composer.json is ...

    "config": {
        "sort-packages": true,
        "allow-plugins": {
            "cweagans/composer-patches": true,
            "drupal/core-composer-scaffold": true,
            "composer/installers": true,
            "wikimedia/composer-merge-plugin": true,
            "oomphinc/composer-installers-extender": true,
            "php-http/discovery": true
        }
    },

Finally, I do have...

  "minimum-stability": "beta",

...rather than "dev".

anybody’s picture

@sirclickalot: Due to the recent changes please execute:

composer require bower-asset/iframe-resizer: ^4

This change was made because requiring an asset-packagist asset in a Drupal module "by hard" is not best practice.
You can also see this additional information in the status report.

sirclickalot’s picture

@anybody,

But issuing that command that installs "version": "5.5.9" and the module page still specifically says...

Important Note: The 5.x library version is not supported as it requires a commercial license for commercial environments. Please use version 4.x.

That statement if backed up by the fact that my targeted <iframe> elements are no longer being resized :-(

Rolling back to module version 2.0.4 via composer reinstates everything and the my <iframe>s are back to their former glory :-)

grevil’s picture

Sorry @sirclickalot for the inconvenience. I actually did not expect composer to automatically remove packages when they aren't required by modules anymore. (Though this is actually not to bad, but an update message would've helped).

@anybody did not provide the correct version. Please run composer require bower-asset/iframe-resizer:^4 though this is also documented inside the README, the module page and a status message should show up in your drupal status report tab.

I'll provide a quick update hook message. So others updating won't get confused.

grevil’s picture

StatusFileSize
new15.31 KB

This should do the trick:
screenshot

anybody’s picture

Thank you, sorry my command was a bit too short and optimistic, I edited my comment. It has to be:

composer require bower-asset/iframe-resizer:^4 like in the docs and status report!

sirclickalot’s picture

Thanks gents, that does all make sense...

composer.json has been updated
Running composer update bower-asset/iframe-resizer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Downgrading bower-asset/iframe-resizer (v5.5.9 => v4.4.5)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downgrading bower-asset/iframe-resizer (v5.5.9 => v4.4.5): Extracting archive
Generating autoload files

Appears to do what we want nicely in terms of the correcting the asset version but alas, despite multiple drush crs, and a drush updb update for good measure, still no <iframe> resizing with the 2.05!

Also, no mention in the status report either.

Something weird going on here.

What else can I should I check to help debug this?

grevil’s picture

Have you cleared the browser cache?

sirclickalot’s picture

Yes, multiple times.

Even tried closing down the stack and restarting as I sometimes suspect other layers of caching too but whatever I try:

  1. No <iframe> resizing
  2. No sign of anything relating to Iframe Resizer in the status report.

Looking in the <head> of the page, the script is being loaded...

<script src="js/iframeResizer.contentWindow.min.js"></script>
sirclickalot’s picture

OK, I have dug a little deeper and I have an update on #17

I actually have two versions of my website:

1) A local DEV version in Drupal 11.3.3 (the one I have been discussing thus far)
2) The current live one still in Drupal 10.6.3

I can now confirm that with the combination of the latest module (2.0.6) and the library (4.4.5):

1) The Drupal 10 site works perfectly, you can see a live instance of it action here (the '6502 Assembler' section): https://bit-by-bit.org/interactive-content/8-bit-cpu-simulator

2) For the Drupal 11 site, the situation is as described in #17 - no resizing.

As with #17 I have confirmed that in both cases the library is being loaded on the page <head>.

There is no mention of Iframe Resizer in any form on either site's Status report page - I am beginning to wonder whether I have misread your earlier statements saying that there should be something there?

To reiterate, rolling back to previous module version via composer on the Drupal 10 site, and all is well again; this really does seem to point the finger at the D11/latest module combo to me.

anybody’s picture

@sirclickalot I was wrong regarding the message in the status report. Currently it's implemented in the way that no message appears if anything is fine and the library is present. I thought it was different, but that won't change things.

I just tried the upgrade in all our projects where we use iframe_resizer and it works flawlessly.

You can either downgrade to a previous version (shouldn't do any harm) or debug the latest module js in your installation to find out why it doesn't run in your specific case, but I can confirm it works perfectly, just the information about the manual composer require was missing.

Should you find any bug in the module, please let us know, but my investigations show that it seems to be specific to your installation and not a bug in the module.

What are your settings at /admin/config/user-interface/iframe_resizer?
Do you see any errors in the browser console?

sirclickalot’s picture

Hi @anybody,

Just to be clear, you've tried it in D10 and D11?

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.