Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTKQ 1.7 build fails due to type definitions in dist being used instead of react #1829

Closed
ghost opened this issue Dec 14, 2021 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Dec 14, 2021

Build fails due to type definitions when using 1.7 however succeeds when downgrading to 1.6.2. Included minimal project to reproduce type errors.

Expected Behavior

Build succeeds with no errors

Current Behavior

Build fails with error: node_modules/@reduxjs/toolkit/dist/query/core/module.d.ts:100:183 - error TS2344: Type 'Definitions[EndpointName]' does not satisfy the constraint 'QueryDefinition<any, any, any, any, string>'

Temporary Workaround

Downgrade to 1.6.2

Steps to Reproduce

Clone example project provided: https://github.com/griffinodow/rtk-query-1.7-build-bug

  1. npm install dependencies
  2. npm run test or run index.ts through tsc
@ghost
Copy link
Author

ghost commented Dec 14, 2021

While running a build through Vite for a project I'm working on I was able to observe this warning. Maybe it can be of help.

vite v2.7.2 building for production...
transforming...
Conflicting namespaces: "node_modules/@reduxjs/toolkit/dist/query/react/rtk-query-react.esm.js" re-exports "createApi" from both "node_modules/@reduxjs/toolkit/dist/query/react/rtk-query-react.esm.js" and "node_modules/@reduxjs/toolkit/dist/query/rtk-query.esm.js" (will be ignored)

@phryneas
Copy link
Member

This seems to be TS 4.5 related, a patch is coming up in #1834.

@markerikson
Copy link
Collaborator

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

No branches or pull requests

2 participants