Skip to content

W-19459009: string-width resolution - #728

Merged
iowillhoit merged 2 commits into
mainfrom
ew/string-width-resolution
Sep 4, 2025
Merged

iowillhoit merged 2 commits into
mainfrom
ew/string-width-resolution

Conversation

@iowillhoit

@iowillhoit iowillhoit commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor

We had test failures in forcedotcom/agents and forcedotcom/packaging due to a dependency change with a major version of string-width

$HOME/dev/agents/node_modules/mocha/node_modules/yargs/build/index.cjs:1040
            width = Math.max(shim.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width);
                                  ^
TypeError: shim.stringWidth is not a function

This was a web of dependencies, this is what I could gather...

  • @salesforce/cli-plugins-testkit@5.3.39 bumped @types/shelljs@0.8.17
    • This brought in glob@11.0.3 → jackspeak@4.1.1 → @isaacs/cliui@8.0.2 → string-width@5.1.2 (ESM)
  • yargs expected CommonJS string-width@4.x (CJS) but got ESM string-width@5.1.2, causing shim.stringWidth to be undefined
  • The 5.x line of string-width switched to ESM. The 4.x line of string-width (CJS) was renamed using the alias syntax as string-width-cjs. Yarn resolves these as separate packages even though they are the same. Breaking deduplication.
    • See this github issue comment for more details
    • Related: Not using yarn 1 would apparently fix this.

@W-19459009@

@iowillhoit iowillhoit changed the title WIP string-width resolution W-19459009: string-width resolution Sep 4, 2025
@iowillhoit
iowillhoit merged commit 4013284 into main Sep 4, 2025
7 checks passed
@iowillhoit
iowillhoit deleted the ew/string-width-resolution branch September 4, 2025 21:01
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.

3 participants