Nextjs 15.2.4 - Next image failed with external images using remotePatterns with typescript : next.config.ts #77911
Unanswered
salimismaila
asked this question in
Help
Replies: 1 comment 3 replies
-
I see that you are actually, trying to use |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hello,
I tryed the last next version : 15.2.4 but next/image doesn't work using external CDN.
exemple :
import Image from "next/image";
export default function Home() {
return (
<div>
<Image
className="dark:invert"
src="https://cdn.site.com/img/logo.png"
alt="Next.js logo" width={180} height={38}
/>
</div>
);
}
next.config.ts
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.site.com',
pathname: '/img/**',
},
],
},
};
export default nextConfig;
Console log
○ Compiling /_not-found ... [TypeError: fetch failed] { [cause]: [Error: read ECONNRESET] { errno: -4077, code: 'ECONNRESET', syscall: 'read' } } ✓ Compiled /_error in 7.9s (1045 modules) GET /_next/webpack-hmr 404 in 8762ms GET /_next/image?url=http%3A%2F%2Fcdn.site.com%2Fimg%2Flogo.png&w=384&q=75 500 in 10461ms GET /_next/image?url=http%3A%2F%2Fcdn.site.com%2Fimg%2Flogo.png&w=384&q=75 500 in 8046ms ○ Compiling /favicon.ico ... ✓ Compiled /favicon.ico in 655ms (499 modules) GET /favicon.ico 200 in 1301ms
The same sample code works fine with Next 15.2.2
Any body knows how to fix this ?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions