Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgraded React - Lazy "ctor is not a function"

I just upgraded React to 17 and I'm getting a weird error.

TypeError: ctor is not a function

enter image description here

My Lazy components get loaded like this

const Course = lazy(() => import('./containers/course'))
const Learner = lazy(() => import('./containers/learners'))
const Report = lazy(() => import('./containers/reports'))
const Home = lazy(() => import('./containers/home'))

Is this the problem!?

I've deleted node_modules etc so many times.

like image 678
beek Avatar asked Jan 25 '26 16:01

beek


1 Answers

You'll have update react-dom to the same version, in my case had to update both react 17.0.2 and react-dom 17.0.0

like image 157
Crisap94 Avatar answered Jan 27 '26 05:01

Crisap94



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!