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

[TS2742] Occurs building a library that depends on @reduxjs/toolkit #58743

Closed
ryuujo1573 opened this issue Jun 3, 2024 · 1 comment
Closed
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@ryuujo1573
Copy link

ryuujo1573 commented Jun 3, 2024

🔎 Search Terms

TS2742, redux, rtk

🕗 Version & Regression Information

I refered to this comment from #42873 and I found that this does not work in typescript@beta (5.5.0-beta) as well.

And if I try import * as foo from '../node_modules/@reduxjs/....' d.ts emission works like a charm.
This doesn't work as d.ts ends up with empty export {};

⏯ Playground Link

https://github.com/ryuujo1573/rtk-ts2742-demo

💻 Code

// only this line fixes the problem
import * as _ from "../node_modules/@reduxjs/toolkit/dist/createSlice"

🙁 Actual behavior

TS2742

🙂 Expected behavior

Resolve type definitions from "@reduxjs/toolkit" (@reduxjs/toolkit/dist/createSlice.d.ts) properly, and generate types as expected

Additional information about the issue

reduxjs/redux-toolkit#3962
and this
reduxjs/redux-toolkit#4066

Tasks

No tasks being tracked yet.
@weswigham
Copy link
Member

This was fixed upstream in @reduxjs/toolkit - they had some inaccessible internal types that needed to be exported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

3 participants