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

Valtion 1.5.0 compile error, with NextJS all latest versions #412

Closed
sivadinesh1 opened this issue Apr 1, 2022 · 6 comments · Fixed by #411
Closed

Valtion 1.5.0 compile error, with NextJS all latest versions #412

sivadinesh1 opened this issue Apr 1, 2022 · 6 comments · Fixed by #411

Comments

@sivadinesh1
Copy link

sivadinesh1 commented Apr 1, 2022

Version 1.4.0 works well. upgrading to Valtio 1.5.0 causes compilation errors.

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/../node_modules/use-sync-external-store/shim' is not supported resolving ES modules imported from /Users/sivadinesh/Documents/products/2022/greenpot/node_modules/valtio/esm/index.mjs
Did you mean to import use-sync-external-store/shim/index.js?
at new NodeError (node:internal/errors:371:5)
at finalizeResolution (node:internal/modules/esm/resolve:414:17)
at moduleResolve (node:internal/modules/esm/resolve:983:10)
at defaultResolve (node:internal/modules/esm/resolve:1080:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
at ModuleWrap. (node:internal/modules/esm/module_job:79:40)
at link (node:internal/modules/esm/module_job:78:36) {
code: 'ERR_UNSUPPORTED_DIR_IMPORT',
url: '/node_modules/use-sync-external-store/shim'

@sivadinesh1 sivadinesh1 changed the title Not Compiling with NextJS all latest versions Valtion 1.5.0 compile error, with NextJS all latest versions Apr 1, 2022
@dai-shi
Copy link
Member

dai-shi commented Apr 1, 2022

Can you try #411?
https://ci.codesandbox.io/status/pmndrs/valtio/pr/411
Please find "Local Install Instructions" in ☝️ .

@sivadinesh1
Copy link
Author

Can you try #411? https://ci.codesandbox.io/status/pmndrs/valtio/pr/411 Please find "Local Install Instructions" in ☝️ .

Create new compile errors.
Error: Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.
at Object.useSyncExternalStore (/Users/sivadinesh/Documents/products/2022/greenpot/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5051:11)
at useSyncExternalStore (/Users/sivadinesh/Documents/products/2022/greenpot/node_modules/react/cjs/react.development.js:1671:21)
at useSnapshot (file:///Users/sivadinesh/Documents/products/2022/greenpot/node_modules/valtio/esm/index.mjs:19:24)

@dai-shi
Copy link
Member

dai-shi commented Apr 2, 2022

@sivadinesh1 Thanks for reporting it!
Now, it's a different error, which is related with pmndrs/zustand#886.
I'll work on the fix. Would you please create a new issue to track it? Thanks.

@MD2990
Copy link

MD2990 commented Apr 2, 2022

Same here

@dai-shi
Copy link
Member

dai-shi commented Apr 2, 2022

@MD2990 Thanks for reporting. You can open a new issue too.

@sivadinesh1
Copy link
Author

created new issue #415

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 a pull request may close this issue.

3 participants