docs/solutions/developer-experience/2026-04-16-next-16-webpack-example-imports-must-use-explicit-maps-and-drop-next-config-eslint.md
The tranche-2 upgrade moved slate-v2 to Next 16.
That exposed two stale assumptions from the older site setup: next.config.js
still carried a now-invalid eslint block, and the example page still used a
template-string dynamic import that let the route bundle crawl files it should
never try to compile.
next build warned that eslint is no longer a supported next.config.js
option.site/examples/ts/custom-types.d.ts with Module parse failed: Unexpected token.site/pages/examples/[example].tsx.eslint.ignoreDuringBuilds config and hoping Next 16 would
ignore it.dynamic(() => import(\../../examples/ts/${path}`))` for the example
page loader.That template string was too broad for the newer Next 16 pass. It let the build
pull .d.ts files into the route bundle.
Fix the site at the exact Next 16 compatibility points:
eslint key from
next.config.js.--webpack path and let Next 16 run on its default
Turbopack build/dev lane.Shape of the fix:
const EXAMPLE_IMPORTERS: Record<
string,
() => Promise<{ default: React.ComponentType }>
> = {
richtext: () => import('../../examples/ts/richtext'),
tables: () => import('../../examples/ts/tables'),
// ...
}
dynamic(EXAMPLE_IMPORTERS[path], {
loading: path === 'huge-document' ? HugeDocumentLoader : ComponentLoader,
})
Next 16 is stricter about site config and about what its route bundler will include from a dynamic import context.
Removing the invalid config gets the build back onto a supported path.
Using an explicit importer map narrows the bundle graph to real example modules
only, so declaration files like custom-types.d.ts stop being treated like
runtime code.
next.config.js keys may have moved or
died; do not carry old config forward on faith..d.ts files as modules, check for a broad
dynamic import before touching the declaration file itself.