Bug report
Describe the bug
With Next6 the modules function for dynamic imports received props, but in Next7 it does not receive any props.
To Reproduce
import dynamic from 'next/dynamic'
const DynamicBundle = dynamic({
modules: ({ name }) => {
const comp = {}
switch (name) {
case 'facebook':
comp.Danamic = import('./icons/Facebook')
break
case 'twitter':
comp.Danamic = import('./icons/Twitter')
break
case 'github':
comp.Danamic = import('./icons/Github')
break
default:
comp.Danamic = import('./icons/Awesome')
break
}
return comp
},
render: (props, { Danamic }) => {
return (
<Danamic {...props} />
)
}
})
export default DynamicBundle
Gives this error Unhandled Rejection (TypeError): Cannot read property 'name' of undefined
Expected behavior
Since the the blog post said dynamic imports are fully backwards-compatible, I expect to receive props in the modules function.
System information
- OS: macOs
- Version of Next.js: 7.0.0
Bug report
Describe the bug
With Next6 the modules function for dynamic imports received props, but in Next7 it does not receive any props.
To Reproduce
Gives this error
Unhandled Rejection (TypeError): Cannot read property 'name' of undefinedExpected behavior
Since the the blog post said dynamic imports are fully backwards-compatible, I expect to receive props in the modules function.
System information