Skip to content

Commit

Permalink
Fix babel config
Browse files Browse the repository at this point in the history
Previously, if you had

```js
export default function App({
  selectedId,
  isEditing,
  searchText,
  something = ['a', 'b'],
}) {
  const [a, b] = something;
  console.log(a, b);
```

this would error with

```console
internal/modules/cjs/loader.js:1102
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /rsc/server-components-demo/node_modules/@babel/runtime/helpers/esm/slicedToArray.js
require() of ES modules is not supported.
```

This updates the babel config on the server to use `useESModules: false`
  • Loading branch information
penx committed Nov 3, 2022
1 parent 29ec743 commit 1a8fc86
Show file tree
Hide file tree
Showing 4 changed files with 4,162 additions and 5,799 deletions.
Loading

0 comments on commit 1a8fc86

Please sign in to comment.