pmndrs / zustand

🐻 Bear necessities for state management in React

Home Page:https://zustand-demo.pmnd.rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

GabLeRoux opened this issue Β· comments

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
> vite-zustand-config-issue@0.0.0 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>(...).

Can you try #2099?

See also: #1991 (comment)

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

The build passed so it seems to be working πŸ‘