Next js unhandled runtime error Invalid src prop
Help to fix, I get the following errors while trying to implement Google auth in my Next js project
Unhandled Runtime Error
Error: Invalid src prop (https://lh3.googleusercontent.com/a/AGNmyxaBHaW4bKYZ-NDsMmOSC2TZd0PoXcy3OM530KQQ=s96-c) on `next/image`, hostname "lh3.googleusercontent.com" is not configured under images in your `next.config.js`
See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host
This error occurs when I try to display the user image returned by Google.
Admin
2023-05-12
This can be fixed by adding google's hostname to your image domain configuration in your next.config.js file as shown below;
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
domains: ['lh3.googleusercontent.com'],
},
}
module.exports = nextConfig
After this is done, stop your development server and start it again.
Similar Content
- Populating PostgreSQL database with data from a psql file
- Error: Invalid src prop (https://lh3.googleusercontent.com) on next/image
- PersistGate' cannot be used as a JSX component. Its instance type 'PersistGate' is not a valid JSX element.
- How to create a custom tooltip for your next.js website
- DeprecationWarning: Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument error on React Native.
Privacy Policy
By using our website,
you agree that devmaesters can store cookies on your device and disclose information in accordance with our privacy policy.