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

default import for shallow is not working since 4.3.0 #1528

Closed
moklick opened this issue Jan 10, 2023 · 6 comments · Fixed by #1531
Closed

default import for shallow is not working since 4.3.0 #1528

moklick opened this issue Jan 10, 2023 · 6 comments · Fixed by #1531

Comments

@moklick
Copy link

moklick commented Jan 10, 2023

Summary

Since 4.3.0 import shallow from 'zustand/shallow' is not working anymore.

Link to reproduction

https://codesandbox.io/s/admiring-feather-0r46z8?file=/src/index.ts

@moklick moklick changed the title default import for shallow is not working since 4.2.0 default import for shallow is not working since 4.3.0 Jan 10, 2023
@dai-shi
Copy link
Member

dai-shi commented Jan 10, 2023

Oh, nice catch. It's because we have two exports, the bundler produces different outputs.

@dai-shi
Copy link
Member

dai-shi commented Jan 11, 2023

#1531 fixes it: https://codesandbox.io/s/crazy-surf-bh6x7l

@stijnvanhulle
Copy link

@dai-shi I'm also having the same issue when using Commonjs(mainly for Jest now) with 4.3.0.

The vanilla export is with version 4.3.0 not resolving, see https://codesandbox.io/s/zustand-vanilla-cjs-3e9m52

@dai-shi
Copy link
Member

dai-shi commented Jan 12, 2023

@stijnvanhulle
Does #1531 resolve it?
https://ci.codesandbox.io/status/pmndrs/zustand/pr/1531
Find "Local Install Instructions" ☝️

@stijnvanhulle
Copy link

@dai-shi Yes your latest commit fixes my issue 👍🏼

1 similar comment
@stijnvanhulle
Copy link

@dai-shi Yes your latest commit fixes my issue 👍🏼

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

Successfully merging a pull request may close this issue.

3 participants