Skip to content

fix(types): fix tsgo (TS 7.0) type errors and re-enable the native-preview CI job - #5344

Merged
EskiMojo14 merged 1 commit into
reduxjs:masterfrom
veksa:fix/tsgo-ts7-type-issues
Jul 20, 2026
Merged

EskiMojo14 merged 1 commit into
reduxjs:masterfrom
veksa:fix/tsgo-ts7-type-issues

Conversation

@veksa

@veksa veksa commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #5156.

Problem

The test-types-native-preview (tsgo) job added in #5155 was disabled because it surfaced type errors under TypeScript 7.0 (tsgo), while tsc stayed green.

Root cause

Not an actual type regression. tsc and tsgo attribute overload errors (TS2769) to different lines: tsc reports them on the call site, tsgo on the argument that failed to match. As a result, some of our @ts-ignore / @ts-expect-error directives sat on the line tsgo doesn't associate with the error, so they either failed to suppress it or were flagged as unused (TS2578).

Changes

  • buildHooks.ts: the preSelector argument to createSelector is a union of the standard and infinite-query pre-selectors; tsgo reports the overload mismatch on that argument line. Added an inline @ts-ignore on the argument, matching the existing one on select(stableArg).
  • mapBuilders.test-d.ts: the two addCase calls that are expected to error had their @ts-expect-error on the builder.addCase( line, but tsgo reports the error on the reducer argument. Collapsed each call onto a single line (with // prettier-ignore) so both compilers attribute the error to the line directly below the directive. Test intent is unchanged — the calls are still expected to error.
  • tests.yml: removed if: false from the test-types-native-preview job so it runs. Kept continue-on-error: true, since it targets a moving -dev build and shouldn't block unrelated PRs if a future nightly changes behavior.

Testing

Verified clean under both tsc 5.9.3 and tsgo 7.0.0-dev across:

  • the source (tsconfig.test.json)
  • the built dist (TEST_DIST=true, prod path aliases erased)
  • the bundler type-portability example

@codesandbox

codesandbox Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web Editor • VS Code • Insiders

Open Preview

@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

✅ Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 974a96f
🔍 Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/6a5e0911a5b52d0008a5fdc9
😎 Deploy Preview https://deploy-preview-5344--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@reduxjs/rtk-codemods

npm i https://pkg.pr.new/@reduxjs/rtk-codemods@974a96f -D
yarn add https://pkg.pr.new/@reduxjs/rtk-codemods@974a96f.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/rtk-codemods@974a96f.tgz -D
bun add https://pkg.pr.new/@reduxjs/rtk-codemods@974a96f.tgz -D

@rtk-query/codegen-openapi

npm i https://pkg.pr.new/@rtk-query/codegen-openapi@974a96f -D
yarn add https://pkg.pr.new/@rtk-query/codegen-openapi@974a96f.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/codegen-openapi@974a96f.tgz -D
bun add https://pkg.pr.new/@rtk-query/codegen-openapi@974a96f.tgz -D

@rtk-query/graphql-request-base-query

npm i https://pkg.pr.new/@rtk-query/graphql-request-base-query@974a96f -D
yarn add https://pkg.pr.new/@rtk-query/graphql-request-base-query@974a96f.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/graphql-request-base-query@974a96f.tgz -D
bun add https://pkg.pr.new/@rtk-query/graphql-request-base-query@974a96f.tgz -D

@reduxjs/toolkit

npm i https://pkg.pr.new/@reduxjs/toolkit@974a96f -D
yarn add https://pkg.pr.new/@reduxjs/toolkit@974a96f.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/toolkit@974a96f.tgz -D
bun add https://pkg.pr.new/@reduxjs/toolkit@974a96f.tgz -D

commit: 974a96f

@EskiMojo14
EskiMojo14 merged commit 58bb0e0 into reduxjs:master Jul 20, 2026
48 checks passed
@EskiMojo14

Copy link
Copy Markdown
Collaborator

thanks!

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.

Investigate TS 7.0 ( tsgo ) type issues

2 participants