Skip to content

zundo@2.0.0-beta.8 incompatible with zustand@v4.3.x #62

@BrunnerLivio

Description

@BrunnerLivio

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]
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions