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

fix(build): a workaround for ESM for use-sync-external-store #953

Merged
merged 2 commits into from
Jul 17, 2022

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented May 11, 2022

This is the same fix as pmndrs/valtio#456, reported in pmndrs/valtio#452.

@dai-shi dai-shi added this to the v4.0.0 milestone May 11, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 11, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a2157ad:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
React Parcel Configuration
Next.js Configuration

@github-actions
Copy link

github-actions bot commented May 11, 2022

Size Change: +99 B (0%)

Total Size: 29.9 kB

Filename Size Change
dist/esm/index.js 415 B +15 B (+4%)
dist/index.js 670 B +28 B (+4%)
dist/system/index.development.js 589 B +14 B (+2%)
dist/system/index.production.js 393 B +7 B (+2%)
dist/umd/index.development.js 816 B +29 B (+4%)
dist/umd/index.production.js 570 B +6 B (+1%)
ℹ️ View Unchanged
Filename Size
dist/context.js 518 B
dist/esm/context.js 448 B
dist/esm/middleware.js 3.09 kB
dist/esm/middleware/immer.js 210 B
dist/esm/shallow.js 272 B
dist/esm/vanilla.js 377 B
dist/middleware.js 3.22 kB
dist/middleware/immer.js 373 B
dist/shallow.js 318 B
dist/system/context.development.js 572 B
dist/system/context.production.js 393 B
dist/system/middleware.development.js 3.18 kB
dist/system/middleware.production.js 2.04 kB
dist/system/middleware/immer.development.js 292 B
dist/system/middleware/immer.production.js 187 B
dist/system/shallow.development.js 338 B
dist/system/shallow.production.js 253 B
dist/system/vanilla.development.js 444 B
dist/system/vanilla.production.js 270 B
dist/umd/context.development.js 662 B
dist/umd/context.production.js 488 B
dist/umd/middleware.development.js 3.33 kB
dist/umd/middleware.production.js 2.05 kB
dist/umd/middleware/immer.development.js 514 B
dist/umd/middleware/immer.production.js 371 B
dist/umd/shallow.development.js 447 B
dist/umd/shallow.production.js 344 B
dist/umd/vanilla.development.js 590 B
dist/umd/vanilla.production.js 378 B
dist/vanilla.js 456 B

compressed-size-action

@dai-shi
Copy link
Member Author

dai-shi commented May 11, 2022

Can anyone (as many as possible) try if this works on their environments?

https://ci.codesandbox.io/status/pmndrs/zustand/pr/953
See "Local Install Instructions"

@dai-shi
Copy link
Member Author

dai-shi commented Jun 2, 2022

It doesn't seem a right workaround: pmndrs/valtio#469

@dai-shi dai-shi closed this Jun 2, 2022
@dai-shi dai-shi deleted the fix/build/uSES-for-ESM branch June 2, 2022 13:02
@dai-shi dai-shi restored the fix/build/uSES-for-ESM branch June 14, 2022 00:56
@dai-shi
Copy link
Member Author

dai-shi commented Jun 14, 2022

Or, should we do it? pmndrs/valtio#469 (comment)

@dai-shi dai-shi reopened this Jun 14, 2022
@dai-shi dai-shi removed this from the v4.0.0 milestone Jun 14, 2022
@vemundeldegard
Copy link

@dai-shi I tried using what was coming from the CodeSandbox, and I'm still having this issue:

 [] info  - Generating static pages (0/15)TypeError: l is not a function
   at a (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js:11:204)
   at /Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js:11:462
   at Object.useSyncExternalStore (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:60:362)
   at exports.useSyncExternalStore (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/react/cjs/react.production.min.js:25:469)
   at exports.useSyncExternalStoreWithSelector (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js:11:489)
   at useStore (file:///Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/zustand/esm/index.mjs:9:17)
   at useBoundStore (file:///Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/zustand/esm/index.mjs:15:51)
   at Jc (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:64:191)
   at Mc (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:66:253)
   at Z (/Users/vemundeldegard/aiflow/autoflow.frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:89)

@dai-shi
Copy link
Member Author

dai-shi commented Jun 15, 2022

Do you mean it doesn't happen without this PR? I mean v4.0.0-rc.1.

@vemundeldegard
Copy link

Do you mean it doesn't happen without this PR? I mean v4.0.0-rc.1.

It happens also when I use this PR. This PR does not work for me. And it also happens on v4.0.0-rc.1.

@dai-shi
Copy link
Member Author

dai-shi commented Jun 15, 2022

It sounds like a different issue then. Please open a new issue with a reproduction.

@dai-shi
Copy link
Member Author

dai-shi commented Jul 17, 2022

Let's see how it goes.

@dai-shi dai-shi merged commit 28e9614 into main Jul 17, 2022
@dai-shi dai-shi deleted the fix/build/uSES-for-ESM branch July 17, 2022 13:03
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 this pull request may close these issues.

2 participants