You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes TypeScript inference issue with apiFetch after @wordpress/api-fetch 7.36.0 update introduced stricter type checking for the Parse generic parameter.
The fix explicitly provides the second type parameter to apiFetch:
// Beforeconstresponse=awaitapiFetch<ContentHelperAPIResponse<T>>(options);// After constresponse=awaitapiFetch<ContentHelperAPIResponse<T>,true>(options);
This ensures TypeScript infers Parse as the literal type true rather than boolean.
Motivation and context
The Build wp-parsely workflow was failing on develop branch after merging PRs #3857, #3875, and #3876. The error:
TS2345: Argument of type 'APIFetchOptions<boolean>' is not assignable to parameter of type 'APIFetchOptions<true>'.
ERROR in /home/runner/work/wp-parsely/wp-parsely/src/content-helper/common/base-provider.tsx
151:65-72
[tsl] ERROR in /home/runner/work/wp-parsely/wp-parsely/src/content-helper/common/base-provider.tsx(151,66)
TS2345: Argument of type 'APIFetchOptions<boolean>' is not assignable to parameter of type 'APIFetchOptions<true>'.
Type 'boolean' is not assignable to type 'true'.
ts-loader-default_e3b0c44298fc1c14
webpack 5.95.0 compiled with 1 error in 30845 ms
Error: Process completed with exit code 1.
We've tried to solve the error in previous PRs, but it seems we need another method to fix the issue.
Based on all this information, open a PR and propose a plan. We'll need to be checking against the develop branch to see whether our changes are fix things or not.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Summary by CodeRabbit
Refactor
Optimized internal API type parameterization for improved consistency with the API wrapper layer.
✏️ Tip: You can customize this high-level summary in your review settings.
To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
📝 Walkthrough
Walkthrough
The apiFetch call in the base provider was modified to include a second generic parameter true, changing from apiFetch<ContentHelperAPIResponse<T>>() to apiFetch<ContentHelperAPIResponse<T>, true>(). This adjusts the type parameterization of the API fetch invocation without modifying runtime behavior or error handling.
Changes
Cohort / File(s)
Change Summary
API Fetch Type Parameter src/content-helper/common/providers/base-provider.tsx
Added second generic parameter true to apiFetch call to adjust response type parameterization
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~5 minutes
Verify that the second generic parameter true is the correct and intended parameterization for this API fetch context
Confirm the change aligns with the apiFetch function's generic signature and type expectations
Possibly related PRs
Fix build error #3731: Modifies the same apiFetch call in base-provider.tsx to enable parsing via a second generic parameter or direct option
Revert "Fix build error" #3732: Changes the same apiFetch call to adjust how the parse flag and typing are supplied through generic parameters
The title clearly and concisely describes the main change: fixing a TypeScript build error caused by @wordpress/api-fetch type changes.
Description check
✅ Passed
The description is comprehensive and follows the template structure with all required sections completed: Description, Motivation and context, How has this been tested, and Screenshots.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Comment @coderabbitai help to get the list of available commands and usage tips.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
CopilotAI
changed the title
[WIP] Fix build errors in develop branch after merges
Fix TypeScript build error caused by @wordpress/api-fetch 7.36.0 type changes
Nov 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes TypeScript inference issue with
apiFetchafter@wordpress/api-fetch7.36.0 update introduced stricter type checking for theParsegeneric parameter.The fix explicitly provides the second type parameter to
apiFetch:This ensures TypeScript infers
Parseas the literal typetruerather thanboolean.Motivation and context
The
Build wp-parselyworkflow was failing ondevelopbranch after merging PRs #3857, #3875, and #3876. The error:Ref: https://github.com/Parsely/wp-parsely/actions/runs/19773492039/job/56662041665
How has this been tested?
Screenshots (if appropriate)
N/A - TypeScript type fix only.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/6ca5c5ee37012743e09e2f9e7c3c272c5e273bb8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r6fj6k /usr/bin/composer install --no-dev --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/LHMQ3c /usr/bin/composer install(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/d71128c702c180ca3b27c761b6773f883394f162/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/antecedent/patchwork/zipball/8b6b235f405af175259c8f56aea5fc23ab9f03ce/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/composer/installers/zipball/12fb2dfe5e16183de69e784a7b84046c43d97e8e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/LHMQ3c /usr/bin/composer install(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/r6fj6k /usr/bin/composer install --no-dev --prefer-dist --no-interaction(http block)https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/abeb5a8b58fda7ac21f15ee596f302f2959a7114/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/php-stubs/wordpress-tests-stubs/zipball/95979e5c671c72350dde78b89e29afdd88c37140/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/phpstan/phpstan-mockery/zipball/98cac6e256b4ee60fdeb26a7dd81bb271b454e80/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b564ca479e7e735f750aaac4935af965572a7845/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/kh3mlS /usr/bin/composer install --no-interaction --no-progress(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/a15e970b8a0bf64cfa5e86d941f5e6b08855f369/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/3v7J1u /usr/bin/composer install --prefer-dist --no-interaction(http block)iojs.org/usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o -(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.