Skip to content

Nuxt Image 2.0.0: image.dir does not work with IPX, but undocumented image.ipx.dir does (TS types reject it) #2270

Description

@simonmaass

Environment

  • Nuxt: 4.4.8
  • @nuxt/image: 2.0.0
  • Package manager: pnpm
  • OS: Windows 11

Reproduction

Project structure:

public/
└── logo.png

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:

  1. image.dir should work as documented for IPX, or
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions