Skip to content

fix: pin @formatjs/cli to 6.9.0 to fix pseudo-locale compilation - #3842

Merged
kevinxh merged 15 commits into
release-3.18.xfrom
kevinxh/test-ci-release-3.18.x
May 21, 2026
Merged

fix: pin @formatjs/cli to 6.9.0 to fix pseudo-locale compilation#3842
kevinxh merged 15 commits into
release-3.18.xfrom
kevinxh/test-ci-release-3.18.x

Conversation

@kevinxh

@kevinxh kevinxh commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pin @formatjs/cli to 6.9.0 in template-retail-react-app
  • Fix verdaccio config to not proxy monorepo @salesforce/* packages, so locally published versions are used in generated project tests

Problem

The generated (retail-react-app-test-project) CI job started failing on May 15, 2026 with:

TypeError: Cannot read properties of undefined (reading 'value')
  at app/utils/locale.test.js:82:37

The test fetchTranslations › loading the pseudo locale expects messages['footer.link.privacy_policy'][1].value to contain pseudo-localized text like Ƥřīṽȧȧƈẏ Ƥǿǿŀīƈẏ, but instead the array only had one element with plain English.

Root Cause (two issues)

1. @formatjs/cli >= 6.15.0 broke --pseudo-locale

Versions 6.15.0+ introduced native platform binaries that silently ignore the --pseudo-locale flag, producing plain English output instead of pseudo-localized text.

2. Verdaccio proxied @salesforce/* to public npm

The local verdaccio registry (used for testing generated projects) had proxy: npmjs for ALL packages including @salesforce/*. This meant:

  • lerna publish from-package checked verdaccio for existing versions
  • Verdaccio proxied to public npm and found @salesforce/retail-react-app@10.0.0 already published
  • Lerna skipped publishing the local version
  • The generated project fetched the PUBLIC tarball (with "@formatjs/cli": "^6.0.4")
  • ^6.0.4 resolved to 6.16.1 (broken native binary) → pseudo-locale compilation failed

Fix

  1. Pin @formatjs/cli to 6.9.0 — last version with working pseudo-locale and Node 18+ support
  2. Remove verdaccio proxy for monorepo packages@salesforce/pwa-kit-*, @salesforce/retail-react-app, @salesforce/commerce-sdk-react no longer proxy to npmjs, ensuring locally published versions always take precedence. Non-monorepo @salesforce/* deps (like cc-datacloud-typescript) still proxy correctly through the generic @*/* rule.

Test plan

  • Reproduced locally: generated project had "@formatjs/cli": "^6.0.4" and broken en-XA.json
  • After fix: generated project has "@formatjs/cli": "6.9.0" and correct pseudo-locale output
  • Ran jest app/utils/locale.test.js in generated project — all 9 tests pass
  • CI generated (retail-react-app-test-project) passes
  • CI changelog-check passes

@git2gus

git2gus Bot commented May 21, 2026

Copy link
Copy Markdown

Git2Gus App is installed but the .git2gus/config.json doesn't have right values. You should add the required configuration.

@cc-prodsec

cc-prodsec commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@formatjs/cli >= 6.15.0 introduced native platform binaries that silently
ignore the --pseudo-locale flag, producing plain English output instead of
pseudo-localized text. This breaks the locale.test.js tests in generated
projects where postinstall recompiles en-XA.json using the latest version.
@kevinxh
kevinxh requested a review from a team as a code owner May 21, 2026 18:03
kevinxh added 2 commits May 21, 2026 11:06
6.15.0+ introduced native binaries that silently ignore --pseudo-locale.
@kevinxh kevinxh changed the title Test CI on release-3.18.x fix: pin @formatjs/cli to 6.14.5 to fix pseudo-locale compilation May 21, 2026
kevinxh added 2 commits May 21, 2026 11:16
npm ci fails when package-lock.json doesn't match package.json.
6.14.5 requires Node >= 20.12.0 which breaks Node 18 CI jobs.
6.9.0 is the last version with working pseudo-locale AND Node 16+ support.
@kevinxh kevinxh changed the title fix: pin @formatjs/cli to 6.14.5 to fix pseudo-locale compilation fix: pin @formatjs/cli to 6.9.0 to fix pseudo-locale compilation May 21, 2026
kevinxh added 7 commits May 21, 2026 11:30
Manual lockfile edits caused npm integrity issues on Windows CI.
Regenerated cleanly with npm install --package-lock-only.
Minimal edit to the original lockfile — only updating the @formatjs/cli
entry from 6.8.0 to 6.9.0 with correct integrity hash and peerDeps.
Preserves all other dependency resolutions to avoid vendor bundle bloat.
The generated project fetches @salesforce/retail-react-app from the
public npm registry (via verdaccio proxy), which has "@formatjs/cli":
"^6.0.4". This resolves to 6.15.0+ which has native binaries that
silently break --pseudo-locale. Pin to 6.9.0 in the generator after
extracting the template.
Local verdaccio was proxying @salesforce/* to public npm, causing
generated projects to use the public registry tarball instead of
the locally published one. This meant local changes to package.json
(like dependency pins) were never reflected in generated projects.

@vcua-mobify vcua-mobify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing that CI test!

@kevinxh
kevinxh merged commit a8341a7 into release-3.18.x May 21, 2026
40 of 41 checks passed
@kevinxh
kevinxh deleted the kevinxh/test-ci-release-3.18.x branch May 21, 2026 21:40
adamraya added a commit that referenced this pull request May 21, 2026
… and changelog entry

Reverts:
- bf3aed5 Add CHANGELOG entry for translation compile script fix
- 0636c23 Make translation compile scripts wait for formatjs to finish

The locale.test.js failure on Node 24 CI is caused by `@formatjs/cli@>=6.15.0`
shipping native binaries that silently emit
"Warning: Pseudo-locale transformations not yet implemented" and produce a
single-element array instead of the expected 3-element pseudo-localized output.
That root cause is fixed in #3842 (pin `@formatjs/cli` to 6.9.0 + verdaccio
config to stop proxying monorepo packages). Reverting both commits since they
were addressing the wrong symptom; we'll merge develop in once #3842 lands.
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.

4 participants