Turbopack Error: esmExternals = "loose" is not supported #78165
Replies: 1 comment
-
I see u're running into this error when trying to use the "esmExternals = 'loose' is not supported" u're not alone — this has confused a lot of people transitioning from Webpack to Turbopack in Next.js. 🧠 Explanation: Turbopack is the new Rust-based bundler introduced in Next.js (as a replacement for Webpack), and it's still under active development. Many Webpack options are not yet supported — including The 📌 How to fix it: ✅ Option 1: Remove In your // ❌ Don't use this with Turbopack
experimental: {
esmExternals: "loose",
}
If u're switching to Turbopack (the default in some newer Next.js versions), just remove the esmExternals field entirely, or set it to false:
// ✅ Compatible with Turbopack
experimental: {
esmExternals: false
}
Option 2: Switch back to Webpack (if u rely on esmExternals)
If u're using packages that require "loose" mode to work, and u’re not ready to migrate to Turbopack, u can opt back into Webpack by explicitly disabling Turbopack:
// next.config.js
const nextConfig = {
// Explicitly use Webpack instead of Turbopack
experimental: {
turbo: false,
esmExternals: "loose"
}
};
module.exports = nextConfig;
Tips
Some packages that depend on CommonJS or mixing ESM/CJS may still break in Turbopack.
u can monitor Turbopack’s progress here: https://turbo.build/pack/docs
If u need more stable support for complex package trees, sticking with Webpack (for now) is safer.
Summary
esmExternals: "loose" is not supported in Turbopack.
u can either remove it, or fallback to Webpack if your project depends on it.
Turbopack is still evolving — avoid using unsupported Webpack flags. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Turbopack version:
664110c1
Error message:
Beta Was this translation helpful? Give feedback.
All reactions