-
Summary
import {createExchange} from 'foo';
const exchange = createExchange();
// exchange.store is a Proxy object from valtio/vanilla
const Component = () => {
const snap = useSnapshot(exchange.store);
return (<div>{snap.foo}</div>);
} This doesn't work and throws:
I've logged:
Do you have an idea? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Still debugging, it looks like its importing .mjs and .js packages: So |
Beta Was this translation helpful? Give feedback.
-
It's called dual package hazard. (which is not supported in valtio.) |
Beta Was this translation helpful? Give feedback.
-
Yeah ok, thank I'll just fork and release another version under my scope, using one package is not an option. |
Beta Was this translation helpful? Give feedback.
-
I got this error when I use valtio in a pnpm monorepo. running |
Beta Was this translation helpful? Give feedback.
It's called dual package hazard. (which is not supported in valtio.)
You have to use only one package.
In the future version of valtio, we may drop
.js
modules.