I am trying to push my code to Vercel, it fails in the build steps when checking the validity of the types.
This is the full error received:
info - Checking validity of types...
Failed to compile.
./node_modules/next/dist/client/image.d.ts:19:14
Type error: Cannot find name 'StaticImageData'.
I tried rolling back the Next.js version to 11, which didn’t work.
Edit:
I found this similar Github issue however it doesn’t seem to have been much help.
https://github.com/vercel/next.js/issues/29788
As of February 16th 2022 this has been fixed, now you can just import StaticImageData like so:
import { StaticImageData } from "next/image"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With