Skip to content

fix(flow-build-tools): prevent EOVERRIDE conflict when upgrading vaadin.version#24213

Merged
platosha merged 9 commits into
mainfrom
codex/fix-npm-eoverride-conflict
May 19, 2026
Merged

fix(flow-build-tools): prevent EOVERRIDE conflict when upgrading vaadin.version#24213
platosha merged 9 commits into
mainfrom
codex/fix-npm-eoverride-conflict

Conversation

@Codex
Copy link
Copy Markdown
Contributor

@Codex Codex AI commented Apr 28, 2026

Fixes #24210

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>PiT 25.2: npm EOVERRIDE conflict when upgrading vaadin.version in projects with direct Vaadin component dependencies</issue_title>
<issue_description>### Description of the bug

When a project has a direct npm dependency on a Vaadin component (e.g. @vaadin/charts) and vaadin.version is upgraded, the vaadin-maven-plugin updates the dependencies section in package.json to the new version but leaves the overrides section pointing to the old version. This causes an npm EOVERRIDE conflict.

npm error code EOVERRIDE
npm error Override for @vaadin/charts@25.2.0-alpha8 conflicts with direct dependency

The root cause is in TaskUpdatePackages.lockVersionForNpm() (line ~160): platform overrides are skipped for existing dependencies ("Skip platform overrides for existing dependencies"). When the dependency version is bumped, the override created in a previous run still pins the old version, but the skip logic prevents it from being updated.

Expected behavior

When vaadin.version is changed, all overrides for Vaadin platform components should be updated to match the new version, or the stale overrides should be removed.

Minimal reproducible example

git clone git@github.com:vaadin/npm-addon-template.git
cd npm-addon-template
git checkout v25
# Upgrade vaadin.version
perl -pi -e 's|(<vaadin.version>)[^<]+(</vaadin.version>)|${1}25.2.0-alpha3${2}|g' pom.xml
# Add prereleases repo
perl -pi -e 's|(\s*)(</project>)|$1$1<repositories><repository><id>v</id><url>https://maven.vaadin.com/vaadin-prereleases</url></repository></repositories>\n$1$2|' pom.xml
perl -pi -e 's|(\s*)(</project>)|$1$1<pluginRepositories><pluginRepository><id>v</id><url>https://maven.vaadin.com/vaadin-prereleases</url></pluginRepository></pluginRepositories>\n$1$2|' pom.xml
# Run dev mode (fails with EOVERRIDE)
mvn -ntp -B -Dserver.port=8080

Workaround: delete package.json before running, the plugin regenerates it cleanly.

Versions

  • Vaadin / Flow version: 25.1.3 upgrading to 25.2.0-alpha3
  • npm: 11.x
  • Node: 24.x / 25.x

Code reference

TaskUpdatePackages.java line ~160:

if (dependencies.has(dependency) || devDependencies.has(dependency)) {
    // Skip platform overrides for existing dependencies
    continue;
}
```</issue_description>

<agent_instructions>This bug can be related to recently added overrides for workbox dependencies, see https://github.com/vaadin/flow/pull/24008.</agent_instructions>

## Comments on the Issue (you are @codex[agent] in this section)

<comments>
<comment_new><author>@mcollovati</author><body>
In addition to the mentioned cause, it is worth noting that vaadin-chart is added to the package.json because it is a transitive dependency of `vaadin-ai-components-flow`, imported by `vaadin-core`.
When running in dev mode, Vaadin uses the full dependency scanner, to if promotes also charts as an used package.</body></comment_new>
</comments>

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

@Codex Codex AI requested a review from mshabarov April 28, 2026 11:22
@mshabarov mshabarov requested review from platosha and removed request for mshabarov April 29, 2026 10:32
@github-actions github-actions Bot added the +0.0.1 label May 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Test Results

 1 392 files   -  3   1 392 suites   - 3   1h 14m 31s ⏱️ -42s
10 044 tests  - 40   9 973 ✅  - 41  70 💤 ±0  1 ❌ +1 
10 519 runs   - 40  10 439 ✅  - 41  79 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit fc6da0c. ± Comparison against base commit b9356e4.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Test Results

 1 410 files  ±0   1 410 suites  ±0   1h 19m 29s ⏱️ -36s
10 160 tests ±0  10 091 ✅ ±0  69 💤 ±0  0 ❌ ±0 
10 635 runs  ±0  10 564 ✅ ±0  71 💤 ±0  0 ❌ ±0 

Results for commit f220a4f. ± Comparison against base commit 1a88177.

♻️ This comment has been updated with latest results.

@platosha
Copy link
Copy Markdown
Contributor

platosha commented May 4, 2026

@codex[agent] there's a failed test reported in Flow Validation check here that needs to be addressed:

Error:  Failures: 
Error:    TaskUpdatePackagesNpmTest.npmIsInUse_packageJsonHasNonNumericVersion_versionNotOverridden:462->verifyVersionLockingWithNpmOverrides:1247 vaadin-element-mixin dependency should not be present ==> expected: <null> but was: <"2.4.2">

@platosha platosha marked this pull request as ready for review May 15, 2026 08:44
@platosha platosha changed the title [WIP] Fix npm EOVERRIDE conflict when upgrading vaadin.version fix(flow-build-tools): prevent EOVERRIDE conflict when upgrading vaadin.version May 15, 2026
@platosha platosha added this pull request to the merge queue May 15, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 15, 2026
@platosha platosha enabled auto-merge May 18, 2026 12:07
@sonarqubecloud
Copy link
Copy Markdown

@platosha platosha added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 3697241 May 19, 2026
33 of 53 checks passed
@platosha platosha deleted the codex/fix-npm-eoverride-conflict branch May 19, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PiT 25.2: npm EOVERRIDE conflict when upgrading vaadin.version in projects with direct Vaadin component dependencies

3 participants