I'm learning Next JS, and I'm trying to export my app to be a static site. As a result, I'm using Cloudinary to process the images, the problem is that they are not showing. Next JS seems to add some parameters to the URL, which break the images, here's an example:
https://res.cloudinary.com/dnliyglel/image/upload/v1624031405/next-tutorial/f_auto,c_limit,w_384,q_auto/images/profile_ileph2.jpg (doesn't work)
https://res.cloudinary.com/dnliyglel/image/upload/v1624031405/next-tutorial//images/profile_ileph2.jpg (does work)
Seems like the extra f_auto,c_limit,w_384,q_auto in the path break it.
Is this because I have a free Cloudinary account? How do I fix this?
For reference, here's my next.config.js:
module.exports = {
basePath: '/out',
assetPrefix: '/out',
images: {
loader: 'cloudinary',
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
path: 'https://res.cloudinary.com/dnliyglel/image/upload/v1624031405/next-tutorial/',
},
exportPathMap: async function() {
const paths = {
'/': { page: '/' },
'/posts/first-post': { page: '/posts/first-post'}
};
return paths;
}
};
And here's an example of how it's added to a component:
<Image
priority
src="/images/profile_ileph2.jpg"
className={utilStyles.borderCircle}
height={144}
width={144}
alt={name}
/>