Skip to content

Commit

Permalink
docs: add troubleshooting to v2 guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence authored Sep 18, 2023
1 parent 7f4168f commit c9ecc92
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/start/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ order: 3

All v2 APIs and behaviors are available in v1 with [Future Flags][future-flags]. They can be enabled one at a time to avoid development disruption of your project. After you have enabled all flags, upgrading to v2 should be a non-breaking upgrade.

If you're having trouble see the [Troubleshooting](#troubleshooting) section.

## `remix dev`

For configuration options, see the [`remix dev` docs][v2-dev-config].
Expand Down Expand Up @@ -815,7 +817,7 @@ module.exports = {

## `serverModuleFormat`

The default server module output format will be changing from `cjs` to `esm`.
The default server module output format will be changing from `cjs` to `esm`. You can continue to use CJS in v2, many dependencies in your app might not be compatible with ESM.

In your `remix.config.js`, you should specify either `serverModuleFormat: "cjs"` to retain existing behavior, or `serverModuleFormat: "esm"`, to opt into the future behavior.

Expand Down Expand Up @@ -1077,6 +1079,16 @@ module.exports = {
};
```

## Troubleshooting

### ESM / CommonJS Errors

```
"SyntaxError: Named export '<something>' not found. The requested module '<something>' is a CommonJS module, which may not support all module.exports as named exports."
```

Please see the [`serverModuleFormat`](#serverModuleFormat) section.

[future-flags]: ./future-flags
[remix-config]: ../file-conventions/remix-config
[flat-routes]: https://github.com/remix-run/remix/discussions/4482
Expand Down

0 comments on commit c9ecc92

Please sign in to comment.