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

using valtio with skypack.dev #452

Closed
s-cork opened this issue May 2, 2022 · 1 comment · Fixed by #456
Closed

using valtio with skypack.dev #452

s-cork opened this issue May 2, 2022 · 1 comment · Fixed by #456
Labels
help wanted Extra attention is needed

Comments

@s-cork
Copy link

s-cork commented May 2, 2022

Currently it fails to import:

>>> var mod = await import("https://cdn.skypack.dev/valtio")

Uncaught SyntaxError: The requested module '/-/use-sync-external-store@v1.0.0-ZzO0qn27iKOvDc2m57IV/dist=es2019,mode=imports/unoptimized/shim/index.js' does not provide an export named 'useSyncExternalStore' (at valtio.js:4:9)

Similar problem with zustand:

>>> var mod = await import("https://cdn.skypack.dev/zustand")

Uncaught SyntaxError: The requested module '/-/use-sync-external-store@v1.1.0-2zD0nsSlmd6FK3zepjJs/dist=es2019,mode=imports/unoptimized/shim/with-selector.js' does not provide an export named 'useSyncExternalStoreWithSelector' (at zustand.js:4:9)

Both errors are from the use-sync-external-store library
versions prior to the inclusion of this library built using skypack.dev

@dai-shi
Copy link
Member

dai-shi commented May 3, 2022

Hi, thanks for reporting.
I'm not sure if this is fixable on our end.
Hope someone has some suggestions.

@dai-shi dai-shi added the help wanted Extra attention is needed label May 3, 2022
ahaoboy added a commit to ahaoboy/valtio that referenced this issue May 10, 2022
ahaoboy added a commit to ahaoboy/valtio that referenced this issue May 10, 2022
ahaoboy added a commit to ahaoboy/valtio that referenced this issue May 10, 2022
fix: dyn import in skypack (close: pmndrs#452)
dai-shi added a commit that referenced this issue May 20, 2022
* fix: dyn import in skypack (close: #452)

fix: dyn import in skypack (close: #452)

* refactor with comments

Co-authored-by: daishi <daishi@axlight.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
diegohaz pushed a commit to ariakit/ariakit that referenced this issue Aug 22, 2023
I am trying to build a library (with sources) that uses **ariakit**
components but I get this error on my application:
`Uncaught Error: Dynamic require of "react" is not supported`

After a deep dive, this error is related to the package
`use-sync-external-store` who only expose `cjs` format as you can see on
this [pull request](https://github.com/pmndrs/zustand/pull/953/files)
and this [issue](pmndrs/valtio#452).

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants