Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions pages/aws/common_issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,30 @@ You might stumble upon this error inside cloudwatch logs: `Cannot find module 'n
Next might incorrectly include some dependencies in the bundle. To remove them you can use this configuration inside `next.config.js`:

```javascript
experimental: {
outputFileTracingExcludes: {
"*": ["node_modules/the-unwanted-package"],
},
},
outputFileTracingExcludes: { // or experimental.outputFileTracingExcludes on Next < 15
"*": ["node_modules/the-unwanted-package"],
},
```

Also you should not add sharp as a dependencies unless absolutely necessary, the image optimization already has it's own version of sharp.

##### Remove sourcemaps

Source maps could add a lot to the bundle, excluding them from standalone output could be worth it.
For example, Sentry does not remove server side sourcemaps, only client ones, even if "deleteSourcemapsAfterUpload" is true. [See the Sentry source code](https://github.com/getsentry/sentry-javascript/blob/develop/packages/nextjs/src/config/webpackPluginOptions.ts#L83).

You could exclude sourcemaps similarly:

```javascript
outputFileTracingExcludes: {
"*": [
'./**/*.js.map',
'./**/*.mjs.map',
'./**/*.cjs.map'
],
},
```

#### Patch fetch behaviour for ISR. Only for [email protected]+

If you use ISR and fetch in your app, you may encounter a bug that makes your revalidate values inconsistent.
Expand Down