Skip to content

Update use-sync-external-store to 1.6.0 to support ESM. #9428

@unional

Description

@unional

Provide a general summary of the issue here

use-sync-external-store@1.4.0 is CJS only. For case of pure ESM repository, during bundling (with tsdown, for example), the bundled code includes __require('react') and fail.

Update to 1.6.0 should address the issue.

🤔 Expected Behavior?

No crash on use in ESM environment

😯 Current Behavior

It crashes on certain bundling scenarios.

💁 Possible Solution

See above

🔦 Context

No response

🖥️ Steps to Reproduce

Repro is not included because it is complicated to do.
It involves bundling the code and then use it in another app.

For details, see facebook/react#24590
and the PR: facebook/react#25231

Version

1.14.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

Palo Alto Networks

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions