Hello everyone,
I am trying to display images hosted in a public bucket on Supabase in my NextJS app hosted on Vercel. I use an <Image>
component for this and configured my next.config.ts
like this:
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
// ... other stuff
images: {
remotePatterns: [
{
protocol: 'https',
hostname: process.env.NEXT_PUBLIC_SUPABASE_URL!,
},
],
},
}
export default nextConfig
The referenced ENV variable is set in my project and managed by the official Supabase integration.
In the live deployment’s dev console in the browser I can see the request for the image failing with a 400
error code when trying to fetch the image from a link like this:
https://<project-url>.vercel.app/_next/image?url=https://<project-id>.supabase.co/storage/v1/object/public/thumbnails/<filename>.jpg&w=1080&q=75
I verified that I can view the link set for the url
parameter directly - this works just fine.
What am I missing here? Do I need to configure remotePatterns
differently? Can I not use ENV variables there?
Thx in advance,
Daniel