Skip to content

fix(deps): keep a single Strapi in the workspace - #260

Merged
derrickmehaffy merged 1 commit into
mainfrom
fix/single-strapi-copy
Oct 13, 2026
Merged

derrickmehaffy merged 1 commit into
mainfrom
fix/single-strapi-copy

Conversation

@derrickmehaffy

Copy link
Copy Markdown
Contributor

What changed and why

Since #242 moved the playgrounds to Strapi 5.57, CI has been failing intermittently on unrelated PRs. #248, #253 and #255 each failed one job: e2e_memory, e2e_redis or boot_smoke on Node 26. All three failed with:

TypeError: strapi.ai.admin.isEnabled is not a function
    at Object.isEnabled [as register] (…/@strapi+content-type-builder@5.52.0_…)
    at Object.register (…/@strapi+core@5.57.0_…)

Cause: the lockfile held two complete Strapi installs, 5.52.0 and 5.57.0.

  • The 5.52 copy was kept alive by the memory provider's auto-installed @strapi/strapi ^5.0.0 peer, still locked at 5.52.0. Dependabot moves the playgrounds' pinned versions, not a locked peer.
  • Strapi core resolves its built-in plugins (content-type-builder, content-manager, upload, …) through the workspace's hoisted node_modules, not through its own dependencies.
  • So a 5.57 app sometimes loaded the 5.52 content-type-builder, which calls an API 5.57 no longer has.

Fix: pnpm dedupe. Every @strapi/* package is now at 5.57.0 only.

  • It adds no package version that wasn't already in the lockfile; I compared the full package sets.
  • It removes 158 duplicate versions (−3046/+245 lines).
  • No package.json range changes, so nothing reaches users.

Guard: a new scripts/check-single-strapi.cjs, run by test:deps, fails when @strapi/strapi or @strapi/core appear at more than one version, and says to run pnpm dedupe.

  • On the previous lockfile: FAIL @strapi/strapi: 2 versions (5.52.0, 5.57.0).
  • On this one: ok.

Tests

Notes for the reviewer

Checklist

  • Tests: a guard that fails on the broken lockfile.
  • Conventional commit subjects, branched from main.

After the playgrounds moved to Strapi 5.57 (#242), the lockfile still held a
complete 5.52 install, kept alive by the memory provider's auto-installed
`@strapi/strapi` peer, which Dependabot never moves. Strapi core resolves its
built-in plugins through the workspace's hoisted node_modules, so a 5.57 app
sometimes loaded the 5.52 content-type-builder and failed to boot:

  TypeError: strapi.ai.admin.isEnabled is not a function

in whichever CI job happened to resolve it - e2e_memory, e2e_redis or
boot_smoke on Node 26, on otherwise unrelated pull requests.

`pnpm dedupe` collapses every @strapi package to 5.57.0. It adds no package
version that was not already in the lockfile and removes 158 duplicates.

scripts/check-single-strapi.cjs, run by test:deps, fails when @strapi/strapi
or @strapi/core appear at more than one version, and says to run
`pnpm dedupe`. It fails on the previous lockfile.
@derrickmehaffy
derrickmehaffy merged commit fc7e5d2 into main Oct 13, 2026
13 checks passed
@derrickmehaffy
derrickmehaffy deleted the fix/single-strapi-copy branch October 13, 2026 04:16
@github-actions github-actions Bot mentioned this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant