Next.js Discord

Discord Forum

`next/image` unconfigured host - env vars

Answered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
I'm getting the error from here https://nextjs.org/docs/messages/next-image-unconfigured-host

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?
Answered by !=tgt
how does the supabase url look like?
View full answer

2 Replies