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

devtools.d.ts node_modules/zustand/middleware/devtools.d.ts:33:42 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members. #2101

Closed
2 of 3 tasks
GabLeRoux opened this issue Oct 4, 2023 · 2 comments · Fixed by #2099

Comments

@GabLeRoux
Copy link

Summary

A change between zustand 4.4.1 and zustand 4.4.2 seem to broke something in middleware/devtools.d.ts 👀

node_modules/zustand/middleware/devtools.d.ts:33:42 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.

npm run build
> [email protected] build
> tsc && vite build

node_modules/zustand/esm/middleware/devtools.d.ts:33:42 - error TS2312: An interface can only extend an object type or intersection of object types with statically known members.

33 export interface DevtoolsOptions extends Config {
                                            ~~~~~~


Found 1 error in node_modules/zustand/esm/middleware/devtools.d.ts:33

Link to reproduction

Project that reproduces issue:

https://github.com/GabLeRoux/vite-zustand-config-issue
There is a github action that builds the project. You can see it's failing on the main branch.

I've created a PR on that same project that demonstrate that this issue doesn't happen when freezing the version to 4.4.1:
GabLeRoux/vite-zustand-config-issue#1

Check List

Please do not ask questions in issues.

  • I've already opened a discussion before opening this issue, or already discussed in other media.

Please include a minimal reproduction.

Please check this if you're filing an issue regarding TypeScript.

  • I've read the typescript guide, in particular that create is to be used as create<T>()(...) and not create<T>(...).
@dai-shi
Copy link
Member

dai-shi commented Oct 4, 2023

Can you try #2099?

See also: #1991 (comment)

@dai-shi dai-shi linked a pull request Oct 5, 2023 that will close this issue
@GabLeRoux
Copy link
Author

Tested here:
GabLeRoux/vite-zustand-config-issue#2

The build passed so it seems to be working 👍

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 a pull request may close this issue.

2 participants