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

@uppy/react: fix use-sync-external-store import #5426

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Conversation

Murderlon
Copy link
Member

Fixes #5396

There's a PR for export map in this package, which would fix this, but it's open for more than a year so it's likely not happening.

@Murderlon Murderlon requested a review from aduh95 August 22, 2024 08:25
@Murderlon Murderlon self-assigned this Aug 22, 2024
Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/react/lib/useUppyState.js b/packages/@uppy/react/lib/useUppyState.js
index fab616e..69d7a11 100644
--- a/packages/@uppy/react/lib/useUppyState.js
+++ b/packages/@uppy/react/lib/useUppyState.js
@@ -1,5 +1,5 @@
 import { useCallback, useMemo } from "react";
-import { useSyncExternalStoreWithSelector } from "use-sync-external-store/with-selector";
+import { useSyncExternalStoreWithSelector } from "use-sync-external-store/with-selector.js";
 export default function useUppyState(uppy, selector) {
   const subscribe = useMemo(() => uppy.store.subscribe.bind(uppy.store), [uppy.store]);
   const getSnapshot = useCallback(() => uppy.store.getState(), [uppy.store]);

@aduh95
Copy link
Contributor

aduh95 commented Aug 23, 2024

There's a PR for export map in this package, which would fix this

If that lands, it will break us now that we're using the file extension. Makes sense not to wait to merge this though

@aduh95 aduh95 merged commit 1358174 into main Aug 23, 2024
17 checks passed
@aduh95 aduh95 deleted the with-selector-import branch August 23, 2024 08:32
@predam
Copy link

predam commented Aug 25, 2024

Hi @Murderlon @aduh95, can someone release a patch version with this fix? Thank you!

@spaiz
Copy link

spaiz commented Aug 25, 2024

Just installed... and got this one :/

node 18

npm install @uppy/react --legacy-peer-deps
		"@uppy/core": "^4.1.2",
		"@uppy/dashboard": "^4.0.3",
		"@uppy/drag-drop": "^4.0.2",
		"@uppy/file-input": "^4.0.1",
		"@uppy/progress-bar": "^4.0.0",
		"@uppy/react": "^4.0.1",
		"@uppy/webcam": "^4.0.1",

Screenshot 2024-08-26 at 0 16 34

@spaiz
Copy link

spaiz commented Aug 26, 2024

Any chance this fixed version was not published to npm? @Murderlon

github-actions bot added a commit that referenced this pull request Aug 26, 2024
| Package     | Version | Package     | Version |
| ----------- | ------- | ----------- | ------- |
| @uppy/react |   4.0.2 | uppy        |   4.2.1 |

- @uppy/react: fix `use-sync-external-store` import (Merlijn Vos / #5426)
- docs: fix Golden Retriever service worker import (mkabatek / #5425)
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.

Error [ERR_MODULE_NOT_FOUND] in useUppyState.js in Vite Remix Application
4 participants