The value at .images.path must be 1 character or more but it was 0 characters
Unanswered
Lanceolated Warbler posted this in #help-forum
Lanceolated WarblerOP
Hi everyone 😄
I have a rather annoying warning
Voici ma configuration :
The thing is, my image source also contains the url to the server and I'm obliged to have the path empty and if I remove it I get :
After several searches, I can't find a solution. Any ideas?
Next Version : 12.1.7-canary.52
Somes links :
I have a rather annoying warning
warn - Invalid next.config.js options detected:
- The value at .images.path must be a string but it was a function.Voici ma configuration :
images: {
loader: 'akamai',
path: '',
}The thing is, my image source also contains the url to the server and I'm obliged to have the path empty and if I remove it I get :
Error: Specified images.loader property (akamai) also requires images.path property to be assigned to a URL prefix.After several searches, I can't find a solution. Any ideas?
Next Version : 12.1.7-canary.52
Somes links :
4 Replies
Beveren
have you tried using a custom image loader? https://nextjs.org/docs/app/api-reference/components/image#loader
if you did something like this:
const customImageLoader = ({
src,
width,
quality
}: ImageLoaderProps): string => {
const url = new URL(src);
return url.href;
};
src,
width,
quality
}: ImageLoaderProps): string => {
const url = new URL(src);
return url.href;
};
and then passed it in : <Image
loader={customImageLoader}
src={image}
alt="Picture"
width={600}
height={50}
/>
loader={customImageLoader}
src={image}
alt="Picture"
width={600}
height={50}
/>