-
-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Reproduction / Severity
At the moment, when you install zundo@2.0.0-beta.8 and have the following in your package.json:
"zustand": "^4.0.0"Then Zustand will automatically update to 4.3.1 (because of the caret ^), resulting in this error:
TypeError: (0 , import_vanilla.default) is not a function
index.js?46cb:334 Uncaught TypeError: (0 , import_vanilla.default) is not a function
at createVanillaTemporal (file:///..../node_modules/zundo/dist/index.js:46:37)
Workaround
I figured out that only zustand v4.3.0/v4.3.1 is causing this issue. Downgrading to npm install zustand@4.2.0 will work as expected.
Debugging
When exploring the compiled node_modules/zundo/dist/index.js file I console.log the import statement of zustand/vanilla:
[...]
// src/temporal.ts
var import_vanilla = __toESM(require("zustand/vanilla"));
console.log(import_vanilla)
var createVanillaTemporal = (userSet, userGet, baseOptions) => {
[...]Which prints the following output:
{
default: {
createStore: [Function: createStore],
default: [Function: vanilla]
},
createStore: [Getter]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working