DEV Community

Agik Setiawan
Agik Setiawan

Posted on

typescript expression produces a union type that is too complex to represent in NextJS, React

I very confusing with error "typescript expression produces a union type that is too complex to represent" in NextJS, React.

After searching, googling i found the solution.

I have got solution from this post

I have "@react-three/drei" and "@react-three/fiber" package in my nextJS application.

Just remove both, and problem is done.

Oldest comments (2)

Collapse
 
cattynip profile image
Seol So

I have the same problem as you did. And the project has the packages @react-three/drei and @react-three/fiber both. But, if I remove them, the project would not be able to work. Is there another way to solve that problem?

Collapse
 
nipunc55 profile image
Nipunc55

"compilerOptions":{
"strict": false,
"incremental": true
}

add these lines tsconfig.json file in root directory