Skip to content

Can't use destructuring assignment in server code #60

Open
@penx

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions