When trying to fetch my Facebook page's posts using the Facebook graph API and nextjs with vercel, I encountered an error: GET imageurl 402 payment required. Oddly enough, this works perfectly fine in localhost:
https://i.sstatic.net/JGy2g.png
I suspect there may be a problem with either vercel or my next.config.js file?
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "scontent-*.xx.fbcdn.net", // * wildcard on dynamic part of domain url
},
{
protocol: "https",
hostname: "**",
},
],
domains: [
"scontent.fcgm1-1.fna.fbcdn.net",
"external.fcgm1-1.fna.fbcdn.net",
],
},
experimental: {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "scontent-*.xx.fbcdn.net", // * wildcard on dynamic part of domain url
},
],
},
},
env: {
ACCESS_TOKEN: process.env.ACCESS_TOKEN,
}
};
module.exports = nextConfig;