# `next/dynamic` has deprecated loading multiple modules at once
#### Why This Error Occurred
The ability to load multiple modules at once has been deprecated in `next/dynamic` to be closer to React's implementation (`React.lazy` and `Suspense`).
Updating code that relies on this behavior is relatively straightforward! We've provided an example of a before/after to help you migrate your application:
#### Possible Ways To Fix It
Migrate to using separate dynamic calls for each module.
* @deprecated the modules option has been planned for removal
*/
render?(props:P,loaded:any):JSX.Element
}
...
...
@@ -117,6 +120,12 @@ export default function dynamic<P = {}>(
typeofdynamicOptions==='object'&&
!(dynamicOptionsinstanceofPromise)
){
if(process.env.NODE_ENV!=='production'){
// show deprecation warning in development
console.warn(
'The modules option for next/dynamic has been deprecated. See here for more info https://err.sh/zeit/next.js/next-dynamic-modules'
)
}
// Support for `render` when using a mapping, eg: `dynamic({ modules: () => {return {HelloWorld: import('../hello-world')}, render(props, loaded) {} } })