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

tsc fails when using functions in valitio/utils #776

Closed
1 of 2 tasks
fukumasuya opened this issue Aug 11, 2023 · 0 comments · Fixed by #777
Closed
1 of 2 tasks

tsc fails when using functions in valitio/utils #776

fukumasuya opened this issue Aug 11, 2023 · 0 comments · Fixed by #777

Comments

@fukumasuya
Copy link
Contributor

fukumasuya commented Aug 11, 2023

Summary

I got the following tsc error when using functions in valtio/utils.

import { proxy } from "valtio";
import { derive } from "valtio/utils";

const state = proxy({ count: 0 });
const derived = derive(
  {
    double: (get) => get(state).count * 2,
  },
  { proxy: state }
);
$ tsc && vite build
node_modules/valtio/vanilla/utils/devtools.d.ts:1:63 - error TS2339: Property '__REDUX_DEVTOOLS_EXTENSION__' does not exist on type 'Window & typeof globalThis'.

This issue occurs with v1.10.6 (does not occur with v1.10.5)
I guess #713 causes this error and the root cause is the same as pmndrs/zustand#1205..

Link to reproduction

https://codesandbox.io/p/sandbox/modest-curran-ptlrl7

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant