Skip to content

Pass --no-frozen-lockfile in pnpm dev mode to prevent CI failures#23794

Merged
manolo merged 1 commit intomainfrom
fix/skip-lockfile-copy-on-version-change
Mar 12, 2026
Merged

Pass --no-frozen-lockfile in pnpm dev mode to prevent CI failures#23794
manolo merged 1 commit intomainfrom
fix/skip-lockfile-copy-on-version-change

Conversation

@manolo
Copy link
Member

@manolo manolo commented Mar 7, 2026

Summary

  • pnpm 10 auto-enables --frozen-lockfile when it detects CI environments
    (via ci-info, checking GITHUB_ACTIONS, CI, etc.)
  • Flow never requests this: ciBuild defaults to false in dev mode
  • When a user bumps vaadin.version and pushes, the stale pnpm-lock.yaml
    causes ERR_PNPM_LOCKFILE_CONFIG_MISMATCH in CI but works locally
  • Fix: explicitly pass --no-frozen-lockfile when running pnpm install
    in dev mode (ciBuild==false), since Flow is resolving dependencies,
    not reproducing a locked build

Context

When ciBuild==true, Flow already passes --frozen-lockfile explicitly.
This change makes the non-CI path equally explicit, preventing pnpm from
silently inheriting a stricter mode based on environment detection.

Fixes #23530

@github-actions github-actions bot added the +0.0.1 label Mar 7, 2026
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Test Results

 1 382 files  ±0   1 382 suites  ±0   1h 26m 25s ⏱️ - 1m 16s
 9 897 tests ±0   9 826 ✅ ±0  71 💤 ±0  0 ❌ ±0 
10 370 runs  ±0  10 290 ✅ ±0  80 💤 ±0  0 ❌ ±0 

Results for commit 6653f45. ± Comparison against base commit 982d05b.

♻️ This comment has been updated with latest results.

@Artur-
Copy link
Member

Artur- commented Mar 7, 2026

Why? The lockfile defines the installed versions. When you upgrade Vaadin, you run dev mode or mvn install locally, and that upgrades what is needed. You cannot and should not upgrade a version in the repo and assume ”npm ci” would work. How would even the new lock file end up in the repo if you would do that?

@manolo
Copy link
Member Author

manolo commented Mar 8, 2026

The lockfile here is not user-committed, it is generated by Flow during dev mode. When a user bumps vaadin.version and pushes, CI runs dev mode but the old pnpm-lock.yaml persists. pnpm 10 auto-detects CI via ci-info (checking GITHUB_ACTIONS, CI, etc.) and activates --frozen-lockfile by default, Flow never requests this, the ciBuild property defaults to false. So the same pnpm install works locally but fails in CI.

Independently of the CI issue, isPlatformMajorVersionUpdated is inconsistent: it skips the stale lockfile copy for 24.x->25.x but not for 25.0->25.1, even though overrides change between minors too.

That said, a broader fix might be better: Flow could pass --no-frozen-lockfile explicitly in dev mode, since it is resolving dependencies, not reproducing a locked build. The version check in this PR helps for the dev-bundle copy path, but in practice a stale lockfile usually already exists on disk and the if (packageLock.exists()) return guard fires before the version check is reached.

@mshabarov mshabarov requested a review from caalador March 9, 2026 12:35
Copy link
Contributor

@caalador caalador left a comment

Choose a reason for hiding this comment

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

This is trying to fix the wrong thing and should instead fix the issue that pnpm 10 does unexpected extra enforcing depending on the environment.

I feel the more correct fix would be to add a dev mode flag that would skip the copy from devbundle if set for use in CI environment upgrade tests.

@manolo
Copy link
Member Author

manolo commented Mar 10, 2026

I agree that changing isPlatformMajorVersionUpdated semantics is not the right approach.

Looking at this more carefully, the cleanest fix is to pass --no-frozen-lockfile explicitly when Flow runs pnpm install in dev mode. The reasoning:

  • Flow is resolving dependencies, not reproducing a locked build, so --frozen-lockfile makes no sense in this context
  • pnpm 10 auto-enables --frozen-lockfile when it detects CI (via ci-info, checking GITHUB_ACTIONS, CI, etc.) - Flow never requests this, but inherits it silently
  • This fixes the problem at the source rather than working around it in the bundle copy logic

A dev mode flag to skip the devbundle copy would work around the symptom but not the cause: even without the bundle copy, a stale pnpm-lock.yaml already on disk triggers the same ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. The --no-frozen-lockfile approach covers both paths.

I will update the PR but need a clear answer what flowers prefer for this fix

@caalador
Copy link
Contributor

I would say run with --no-frozen-lockfile if dev mode build and ciBuild==false

pnpm 10 auto-enables --frozen-lockfile when it detects CI via ci-info,
causing ERR_PNPM_LOCKFILE_CONFIG_MISMATCH when overrides change between
Vaadin versions. Explicitly pass --no-frozen-lockfile in dev mode
(ciBuild==false) since Flow is resolving dependencies, not reproducing
a locked build.

Revert isPlatformMajorVersionUpdated changes as the lockfile flag
approach fixes the root cause.
@manolo manolo force-pushed the fix/skip-lockfile-copy-on-version-change branch from 40567da to 6653f45 Compare March 11, 2026 15:25
@manolo manolo changed the title Skip lockfile copy from bundle when platform version changes Pass --no-frozen-lockfile in pnpm dev mode to prevent CI failures Mar 11, 2026
@manolo
Copy link
Member Author

manolo commented Mar 11, 2026

I would say run with --no-frozen-lockfile if dev mode build and ciBuild==false

done

@sonarqubecloud
Copy link

@manolo manolo merged commit b939f25 into main Mar 12, 2026
32 checks passed
@manolo manolo deleted the fix/skip-lockfile-copy-on-version-change branch March 12, 2026 08:07
vaadin-bot pushed a commit that referenced this pull request Mar 12, 2026
…3794)

pnpm 10 auto-enables --frozen-lockfile when it detects CI via ci-info,
causing ERR_PNPM_LOCKFILE_CONFIG_MISMATCH when overrides change between
Vaadin versions. Explicitly pass --no-frozen-lockfile in dev mode
(ciBuild==false) since Flow is resolving dependencies, not reproducing
a locked build.

Revert isPlatformMajorVersionUpdated changes as the lockfile flag
approach fixes the root cause.
vaadin-bot added a commit that referenced this pull request Mar 12, 2026
…3794) (#23842)

pnpm 10 auto-enables --frozen-lockfile when it detects CI via ci-info,
causing ERR_PNPM_LOCKFILE_CONFIG_MISMATCH when overrides change between
Vaadin versions. Explicitly pass --no-frozen-lockfile in dev mode
(ciBuild==false) since Flow is resolving dependencies, not reproducing
a locked build.

Revert isPlatformMajorVersionUpdated changes as the lockfile flag
approach fixes the root cause.

Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PiT 25.1: pnpm install fails with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH after version bump from 25.0 to 25.1

4 participants