This content originally appeared on flaviocopes.com and was authored by flaviocopes.com
I got this error while working with Next.js:
TypeError: Constructor requires 'new' operator
Turns out I used the <Image />
component provided by next/image
but I forgot to import it on top:
import Image from 'next/image'
It can be tricky especially if you are moving some JSX around components.
This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

flaviocopes.com | Sciencx (2021-07-09T05:00:00+00:00) Next.js, how to fix the error `Constructor requires ‘new’ operator`. Retrieved from https://www.scien.cx/2021/07/09/next-js-how-to-fix-the-error-constructor-requires-new-operator/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.