Skip to content

fix: support Angular CLI 21.2.x findUpSync rename#571

Merged
arturovt merged 1 commit intomasterfrom
schematics-tests_2
Mar 30, 2026
Merged

fix: support Angular CLI 21.2.x findUpSync rename#571
arturovt merged 1 commit intomasterfrom
schematics-tests_2

Conversation

@arturovt
Copy link
Copy Markdown
Member

In Angular CLI 21.2, the synchronous findUp utility was renamed to findUpSync, making the old findUp async. Importing findUp statically then passing its return value (now a Promise) as a file path caused:

  "The "path" argument must be of type string or an instance of Buffer
  or URL. Received an instance of Promise."

Replace the static import with a runtime require that prefers findUpSync (21.2+) and falls back to findUp (≤21.1), keeping compatibility across both CLI ranges without breaking existing behaviour.

In Angular CLI 21.2, the synchronous findUp utility was renamed to
findUpSync, making the old findUp async. Importing findUp statically
then passing its return value (now a Promise) as a file path caused:

  "The "path" argument must be of type string or an instance of Buffer
  or URL. Received an instance of Promise."

Replace the static import with a runtime require that prefers findUpSync
(21.2+) and falls back to findUp (≤21.1), keeping compatibility across
both CLI ranges without breaking existing behaviour.
@arturovt arturovt force-pushed the schematics-tests_2 branch from 377cd23 to 9700ae5 Compare March 30, 2026 20:25
@arturovt arturovt merged commit a8dba52 into master Mar 30, 2026
1 check passed
@arturovt arturovt deleted the schematics-tests_2 branch March 30, 2026 20:29
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