`next/image` unconfigured host - env vars
Answered
Giant panda posted this in #help-forum
Giant pandaOP
I'm getting the error from here https://nextjs.org/docs/messages/next-image-unconfigured-host
My next.config looks like:
If I
My next.config looks like:
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: process.env.NEXT_PUBLIC_SUPABASE_URL,
port: '',
pathname: '/storage/v1/object/public/assets/**',
},
],
},
};
export default nextConfig;
If I
console.log(nextConfig.images.remotePatterns)
, I see my supabase URL there, yet I still get the unconfigured host error. Is it not possible to use an env var there?2 Replies
Giant pandaOP
ah, good point. it has the protocol in the URL in the env var. thank you 😅