#`next/image` unconfigured host - env vars

4 messages · Page 1 of 1 (latest)

unborn gate
#

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?

main hedgeBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

spice basin
unborn gate
#

ah, good point. it has the protocol in the URL in the env var. thank you 😅