DEV Community

Agik Setiawan
Agik Setiawan

Posted on

4 1

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.

Top 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

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay