Skip to content

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Jun 28, 2025

Originally reported at Slack: https://wordpress.slack.com/archives/C02QB2JS7/p1751138157139149

What?

This fixes the CI failure by updating package-lock.json.

Why?

Somehow, the npm packages became inconsistent and started giving errors when running npm ci:

$ npm ci
npm error code EUSAGE
npm error
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Invalid: lock file's @floating-ui/dom@1.6.3 does not satisfy @floating-ui/dom@1.7.2
npm error Invalid: lock file's @floating-ui/core@1.4.1 does not satisfy @floating-ui/core@1.7.2
npm error Invalid: lock file's @floating-ui/utils@0.1.6 does not satisfy @floating-ui/utils@0.2.10
npm error
npm error Clean install a project
npm error
npm error Usage:
npm error npm ci
npm error
npm error Options:
npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
npm error [--no-bin-links] [--no-fund] [--dry-run]
npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm error [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm error
npm error aliases: clean-install, ic, install-clean, isntall-clean
npm error
npm error Run "npm help ci" for more info
npm error A complete log of this run can be found in: /home/t-hamano/.npm/_logs/2025-06-28T13_50_18_765Z-debug-0.log

The packages haven't been updated recently, so it's unclear why this issue suddenly started happening.

How?

Run npm install --package-lock-only

Testing Instructions

Let's see if this PR passes CI.

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components labels Jun 28, 2025
@t-hamano
Copy link
Contributor Author

The reason some CIs are failing is probably because they are pointing to a different branch and running npm ci on it.

@t-hamano t-hamano marked this pull request as ready for review June 28, 2025 13:58
@github-actions
Copy link

github-actions bot commented Jun 28, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: johnbillion <johnbillion@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano
Copy link
Contributor Author

t-hamano commented Jun 29, 2025

Now npm ci runs correctly, but the underlying version inconsistency problem seems to remain:

npm ls @floating-ui/react-dom
gutenberg@21.1.0-rc.1 /home/t-hamano/projects/_core-dev/gutenberg
└─┬ @wordpress/components@29.12.0 -> ./packages/components
  └── @floating-ui/react-dom@2.0.1 invalid: "^2.0.8" from packages/components

npm error code ELSPROBLEMS
npm error invalid: @floating-ui/react-dom@2.0.1 /home/t-hamano/projects/_core-dev/gutenberg/packages/components/node_modules/@floating-ui/react-dom
npm error A complete log of this run can be found in: /home/t-hamano/.npm/_logs/2025-06-29T01_01_56_050Z-debug-0.log

The underlying reason seems to be that the version of the @floating-ui/react-dom package is defined as "^2.0.8", but in package-lock.json, a lower version, "2.0.1", is defined.

I guess that there are two possible ways to fundamentally solve this problem.

  • Reinstall without changing the version specification from "^2.0.8". This will install the latest version, 2.1.4.
  • Pin the version to "2.0.8" and then reinstall.

Either way, package-lock.json should be updated appropriately, and dependencies should be resolved correctly.

According to the changelog it should be fine to update to the latest version, but for now I want to pin the version by the command below:

npm uninstall @floating-ui/react-dom -w packages/components
npm install @floating-ui/react-dom@2.0.8 -w packages/components

Furthermore, it appears that similar issues have occurred in the past: #48402

@t-hamano t-hamano requested a review from ajitbohra as a code owner June 29, 2025 01:30
@t-hamano t-hamano requested review from a team and Mamaduka June 29, 2025 01:39
Copy link
Member

@johnbillion johnbillion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to get to the root cause of this, but also it would be good to have the tests in Gutenberg and core passing again. Let's get this in.

@t-hamano
Copy link
Contributor Author

t-hamano commented Jun 30, 2025

@johnbillion Thanks for the review! I'd like to merge this pr for now to unblock other PRs and core development. I will follow up if necessary.

Furthermore, I noticed that this PR also occurs in the wp/6.8 branch. We will need to backport this PR to the branch for the 6.8.2 release.

@t-hamano t-hamano merged commit 1b8efa7 into trunk Jun 30, 2025
62 of 65 checks passed
@t-hamano t-hamano deleted the fix-static-analisys branch June 30, 2025 00:56
@t-hamano t-hamano added the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Jun 30, 2025
@github-actions github-actions bot added this to the Gutenberg 21.2 milestone Jun 30, 2025
t-hamano added a commit that referenced this pull request Jun 30, 2025
* Fix Floating UI packages dependencies

* Pin @floating-ui/react-dom version
@talldan talldan added the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Jul 2, 2025
talldan pushed a commit that referenced this pull request Jul 2, 2025
* Fix Floating UI packages dependencies

* Pin @floating-ui/react-dom version
@talldan
Copy link
Contributor

talldan commented Jul 2, 2025

I just cherry-picked this PR to the release/21.1 branch to get it included in the next release: d885c78

@talldan talldan removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Jul 2, 2025
Mamaduka pushed a commit that referenced this pull request Jul 8, 2025
* Fix Floating UI packages dependencies

* Pin @floating-ui/react-dom version
@t-hamano
Copy link
Contributor Author

t-hamano commented Jul 8, 2025

This PR was cherry-picked into the wp/6.8 branch for the WP 6.8.2 release: #70557

@t-hamano t-hamano removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants