I'm getting this error message:
`next/dynamic` options should contain `modules` and `render` fields
Here's my code:
import dynamic from 'next/dynamic'
const RoutesMap = dynamic(import("./components/routesMap"), {
ssr: false
})
// routesMap
import * as React from 'react'
class RoutesMap extends React.Component {
render() {
return (
<div>
<p>hello</p>
</div>
)
}
}
export default RoutesMap
this gets compiled via typescript and the result is this:
const RoutesMap = dynamic_1.default(Promise.resolve().then(() => require('./components/routesMap')), { ssr: false });
and if I use
import * as dynamic from 'next/dynamic'
I get:
dynamic is not a function
tsconfig:
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"jsx": "react-native",
"allowJs": true,
"baseUrl": ".",
"paths": {
"!/*": [
"./*"
]
},
"lib": [
"es5",
"es6",
"dom",
"es2015.core",
"es2015.collection",
"es2015.generator",
"es2015.iterable",
"es2015.promise",
"es2015.proxy",
"es2015.reflect",
"es2015.symbol",
"es2015.symbol.wellknown",
"esnext.asynciterable"
]
}
}
"next": "^4.1.4",
"react": "^16.2.0",
"react-dom": "^16.2.0"
I'm getting this error message:
Here's my code:
this gets compiled via typescript and the result is this:
and if I use
I get:
tsconfig: