Next image not load Next14
Answered
Md.Mohon posted this in #help-forum
Md.MohonOP
When i am try to load a dynamic image using next/image component then throw me an error (error image i have attached).
how to slove this error? please help me.
I am using next.js 14 app router
how to slove this error? please help me.
I am using next.js 14 app router
56 Replies
Md.MohonOP
&752637460550385834
@ᴉuɐpɹɐɐ
Common House-Martin
don't quote individual people, it's against the rules
@Common House-Martin don't quote individual people, it's against the rules
Md.MohonOP
ok sorry.
Can you please see this issue
Can you please see this issue
Common House-Martin
where you getting the url? from your api?
Gazami crab
what did you get from console?
@Common House-Martin where you getting the url? from your api?
Md.MohonOP
i am using this blurImage componet in my product page card section
Common House-Martin
it's a certificate issue i think, you running a proxy? a vm? vpn? is your pc time correct?
try
npm config set strict-ssl falseif not i have no clue
@Common House-Martin it's a certificate issue i think, you running a proxy? a vm? vpn? is your pc time correct?
Md.MohonOP
no! i don't use any vm or vpn.
@Md.Mohon no! i don't use any vm or vpn.
Gazami crab
did you check next.config?
or encoding problem. GET looks like https:// -> https%3A%2F%2Fresres:
Gazami crab
can you check this please? if it's not working, it's out of my hand..
const originUrl = props?.src
const encodeUrl = encodeURIComponent(originUrl);
src={encodeUrl}
const originUrl = props?.src
const encodeUrl = encodeURIComponent(originUrl);
src={encodeUrl}
@Common House-Martin try npm config set strict-ssl false
Md.MohonOP
when i am run this command then why not run my node.js server getting mongoDb error
Gazami crab
can you show console of originUrl and encodeUrl
Md.MohonOP
yes
@Md.Mohon yes
Northeast Congo Lion
app router or pages router?
with app router, u mneed to configure remote patterns
https://nextjs.org/docs/app/api-reference/components/image#remotepatterns
with app router, u mneed to configure remote patterns
https://nextjs.org/docs/app/api-reference/components/image#remotepatterns
@Md.Mohon app router
Northeast Congo Lion
please share the code snippet where ur working '
ideally, the full component or page whuich is causing issues.
Md.MohonOP
@Md.Mohon Click to see attachment
Md.MohonOP
Is the error
@Md.Mohon Is the error
Northeast Congo Lion
did u configure remote patterns as I sent u ?
module.exports = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
],
},
}if still not working, please share ur up-to-date error alongwith the value of the image src
as others mentioned, it looks to be using an encoded url in src?
@Northeast Congo Lion did u configure remote patterns as I sent u ?
Md.MohonOP
yes same to you
and still now throw same error
i not using encoded url i am using direct image ulr like https://res.cloudinary.com/wolfecom/image/upload/v1713238167/cld-sample-5.jpg
and still now throw same error
i not using encoded url i am using direct image ulr like https://res.cloudinary.com/wolfecom/image/upload/v1713238167/cld-sample-5.jpg
Northeast Congo Lion
okay, can u send the actual component and not a screenshot from earlier.
Md.MohonOP
sure can you join meet link. cause here i am use multiple component so if you join the meet then help to me
in this image line no. 144 i am use the blurImage component
@Md.Mohon Click to see attachment
Md.MohonOP
here is the blurImage component
that have i am use the next/image
Northeast Congo Lion
so if u remove the blurImage component from the parent component?
u have no error?
removing the image should mean app works fine, yes?
Md.MohonOP
yes app working fine and don't have and the fetch fail error
Northeast Congo Lion
right
Md.MohonOP
the error throw is the blurImage component and i am test another next 13 app using the next/image they have throw the same error.
so how can i solve this problem?
is the tls certificate error. is any network related issue?
so how can i solve this problem?
is the tls certificate error. is any network related issue?
Northeast Congo Lion
ive never had an issue with using remote image on localhost with http
Md.MohonOP
i am using the local mongodb have this reason?
@Md.Mohon i am using the local mongodb have this reason?
Northeast Congo Lion
if u use other image that is not from res.cloudinary.com does it work?
Northeast Congo Lion
ok so all images break regardless of source
@Md.Mohon no
Northeast Congo Lion
Answer
Md.MohonOP
@Northeast Congo Lion thanks in this doc help to me
thanks a lot
Northeast Congo Lion
Awesome
So @Md.Mohon you solved the problem
Md.MohonOP
yes
Northeast Congo Lion
Great news
(let me know if i chose the wrong message)