Skip to content

Bug: Support ESM for the use-sync-external-store shim #24590

@s-cork

Description

@s-cork

React version:
use-sync-external-store 1.0.0, 1.1.0

Steps To Reproduce

  1. open up chrome dev tools
>>> var x = await import("https://cdn.skypack.dev/use-sync-external-store")
>>> x.useSyncExternalStore
undefined

Link to code example:
See above code snippet
I was trying to hack around with valtio
and if I do

import valtio from "https://cdn.skypack.dev/[email protected]";

or in the console

>>> var v = await import("https://cdn.skypack.dev/[email protected]")
Uncaught SyntaxError: The requested module '/-/[email protected]/dist=es2019,mode=imports/unoptimized/shim/index.js' does not provide an export named 'useSyncExternalStore' 

The current behavior

the use-sync-external-store shim does not support esm

The expected behavior

please support esm

additional context

the bug was reported at valtio

pmndrs/valtio#452
An attempt was made to workaround the issue at their end
But the import
>>> var v = await import("https://cdn.skypack.dev/[email protected]")
Still fails on the use-sync-external-store shim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions