Next.js · Senior · Question 17 of 75

When do you need the serverExternalPackages option?

Explanation

By default, Next.js bundles the dependencies of server code. Some packages (with native bindings, dynamic requires, large binaries) break when bundled - they're marked as external and loaded from node_modules at runtime. Popular cases are already on the default list.

Further reading

Problem with a question

Next.js · Senior · question 17

Test yourself

Take the Next.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz