Environment
- Nuxt: 4.4.8
- @nuxt/image: 2.0.0
- Package manager: pnpm
- OS: Windows 11
Reproduction
Project structure:
Component:
<NuxtImg
src="/logo.png"
alt="Logo"
width="20"
height="20"
/>
The static file is accessible:
http://localhost:3000/logo.png
However, the generated IPX URL fails:
http://localhost:3000/_ipx/s_40x40/logo.png
with:
{
"error": {
"message": "[404] [IPX_FILE_NOT_FOUND] File not found: /logo.png"
}
}
Configuration that does NOT work
image: {
provider: 'ipx',
dir: 'public'
}
This still produces:
[IPX_FILE_NOT_FOUND] File not found: /logo.png
Configuration that DOES work
image: {
provider: 'ipx',
ipx: {
dir: 'public'
}
}
After using the above config, IPX correctly resolves files from public/.
TypeScript issue
The working configuration produces a TS error:
Object literal may only specify known properties,
and 'dir' does not exist in type 'Partial<IPXOptions>'.
Example:
image: {
provider: 'ipx',
ipx: {
dir: 'public'
}
}
Expected behavior
Either:
image.dir should work as documented for IPX, or
image.ipx.dir should be documented and typed correctly.
Actual behavior
image.dir does not appear to affect IPX file resolution.
image.ipx.dir fixes the issue at runtime.
- TypeScript rejects
image.ipx.dir.
Additional notes
This appears to be a mismatch between runtime behavior and TypeScript definitions. Runtime is reading image.ipx.dir, but the exposed IPXOptions type does not include dir.
Environment
Reproduction
Project structure:
Component:
The static file is accessible:
However, the generated IPX URL fails:
with:
{ "error": { "message": "[404] [IPX_FILE_NOT_FOUND] File not found: /logo.png" } }Configuration that does NOT work
This still produces:
Configuration that DOES work
After using the above config, IPX correctly resolves files from
public/.TypeScript issue
The working configuration produces a TS error:
Example:
Expected behavior
Either:
image.dirshould work as documented for IPX, orimage.ipx.dirshould be documented and typed correctly.Actual behavior
image.dirdoes not appear to affect IPX file resolution.image.ipx.dirfixes the issue at runtime.image.ipx.dir.Additional notes
This appears to be a mismatch between runtime behavior and TypeScript definitions. Runtime is reading
image.ipx.dir, but the exposedIPXOptionstype does not includedir.