Skip to content

Conversation

@remcohaszing
Copy link
Contributor

What?

Add type definitions to the image loader file documentation.

Why?

This provides type safety for users.

How?

Use the ImageLoaderProps type to annotate the image loader argument.

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Oct 29, 2025
@ijjk
Copy link
Member

ijjk commented Oct 29, 2025

Allow CI Workflow Run

  • approve CI run for commit: a9d79aa

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Comment on lines 179 to 180
const params = [`w_${width}`, `cmpr_${compression}`)]
return `https://example.com${src}?imgeng=/${params.join('/')`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two syntax errors in the imageengine loader example:

  1. Line 179 has an extra closing parenthesis in the array definition:

    const params = [`w_${width}`, `cmpr_${compression}`)]

    Should be:

    const params = [`w_${width}`, `cmpr_${compression}`]
  2. Line 180 has a misplaced backtick in the return statement:

    return `https://example.com${src}?imgeng=/${params.join('/')`

    Should be:

    return `https://example.com${src}?imgeng=/${params.join('/')}`

These syntax errors would prevent the loader from functioning correctly.

Suggested change
const params = [`w_${width}`, `cmpr_${compression}`)]
return `https://example.com${src}?imgeng=/${params.join('/')`
const params = [`w_${width}`, `cmpr_${compression}`]
return `https://example.com${src}?imgeng=/${params.join('/')}`

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants