Type '{}' is not assignable to type 'ReactNode'.
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
“next”: “12.1.4”,
“react”: “^17.0.2”,
“react-dom”: “^17.0.2”,
file tsconfig.json
{
"compilerOptions": {
"target": "es6",
"esModuleInterop": true,
"importHelpers": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"lib": [
"dom",
"dom.iterable",
"esnext",
"es5",
"es6"
],
"baseUrl": ".", // setting a value for baseUrl is required
"paths": {
"@/*": [
"*"
],
"~/*": [
"*"
]
},
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"declaration": true,
"downlevelIteration": true,
"noUnusedParameters": false,
"noUnusedLocals": false,
"incremental": true
},
"exclude": [
"node_modules",
".next",
".vscode",
"out"
],
"include": [
"**/styles/**/*",
"**/*.ts",
"**/*.tsx",
"**/*.yml",
"**/*.yaml",
"**/*.css",
"**/*.scss",
"**/*",
".d.ts",
"next-env.d.ts",
]
}
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
The issue is that after upgrading to the last nextjs version, I am getting the error Type 'Component<{}, any, any>' is not assignable to type 'Element | ElementClass | null'
for all components that are imported dynamically.
Workaround: Change dynamic import to normal import solves the issue
Expected Behavior
it should work.
To Reproduce
create a component and import it dynamically
Issue Analytics
- State:
- Created a year ago
- Reactions:19
- Comments:29 (2 by maintainers)
Top Results From Across the Web
Type '{}' is not assignable to type 'ReactNode' - Stack Overflow
We started experiencing this issue on our build server without making significant changes last week and have not managed to find a fix...
Read more >Type {} is not assignable to ReactNode FIX - YouTube
In this video extract we fix the react native typescript error: Type {} is not assignable to ReactNode.
Read more >jsx element not assignable type functioncomponent
The React.js error "Type '() => JSX.Element[]' is not assignable to type FunctionComponent" occurs when we try to return an array of elements...
Read more >type 'number' is not assignable to type 'reactnode'. - You.com
Type 'number or undefined' is not assignable to type number # The "Type 'number | undefined' is not assignable to type number" error...
Read more >Type 'ReactPortal' is not assignable to type 'ReactNode' - Reddit
Hello with the new @types/react I'm facing several issues. One of them is Type 'ReactPortal' is not assignable to type 'ReactNode'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I´m having the same issue. the app build doesn´t run correctly. Yesterday was running correctly. Today is broken
I have the same problem 😦 ecosystem project: react-ts All dependencies in the project aren’t auto-updating and are hardcoded (without ^) yesterday it works correctly too, today it is broken.