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

Can't use destructuring assignment in server code #60

Open
penx opened this issue Nov 3, 2022 · 0 comments · May be fixed by #61
Open

Can't use destructuring assignment in server code #60

penx opened this issue Nov 3, 2022 · 0 comments · May be fixed by #61

Comments

@penx
Copy link

penx commented Nov 3, 2022

As mentioned (in more detail) at facebook/react#23126 (comment)

If you use destructuring assignment in a server component, you get a babel error:

/server-components-demo/src/App.server.js:141
undefined
      ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /server-components-demo/node_modules/@babel/runtime/helpers/esm/slicedToArray.js from /server-components-demo/src/App.server.js not supported.
Instead change the require of slicedToArray.js in /server-components-demo/src/App.server.js to a dynamic import() which is available in all CommonJS modules.
@penx penx linked a pull request Nov 3, 2022 that will close this issue
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.

1 participant