# Error: Invalid src prop on `next/image`, relative paths are not supported for remote images

- **ID:** `nextjs/next-image-src-relative-path`
- **Domain:** nextjs
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

The next/image component requires absolute URLs for remote images. Providing a relative path (e.g., '/images/photo.jpg') without a configured remotePatterns or loader causes this error, as Next.js cannot resolve the base URL for optimization.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| next@13.5.0 | active | — | — |
| next@14.0.0 | active | — | — |
| next@15.0.0 | active | — | — |

## Workarounds

1. **Use an absolute URL by constructing it from the environment variable or request host.** (95% success)
   ```
   Use an absolute URL by constructing it from the environment variable or request host.
   ```
2. **Configure remotePatterns in next.config.js and use a relative path that matches the pattern.** (90% success)
   ```
   Configure remotePatterns in next.config.js and use a relative path that matches the pattern.
   ```

## Dead Ends

- **** — This still resolves to a relative path on the server, not an absolute URL; the error persists. (80% fail)
- **** — This disables optimization but doesn't fix the path resolution; the error still occurs. (90% fail)
