Unverified Commit f3fcb81d authored by Steven's avatar Steven Committed by GitHub

Relax restriction of `images.path` in next.config.js (#30741)

The built-in `imgixLoader()` unexpectedly works with `image.path = ''` and `src` as an absolute URL.

So we need to relax this restriction for now until we can officially deprecate built-in loaders (eventually they can all be implemented in userland via loader prop).

- Follow up to #30080 
parent 2027d1fe
...@@ -292,7 +292,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { ...@@ -292,7 +292,7 @@ function assignDefaults(userConfig: { [key: string]: any }) {
if ( if (
images.loader !== 'default' && images.loader !== 'default' &&
images.loader !== 'custom' && images.loader !== 'custom' &&
!(images.path || '').startsWith('http') images.path === imageConfigDefault.path
) { ) {
throw new Error( throw new Error(
`Specified images.loader property (${images.loader}) also requires images.path property to be assigned to a URL prefix.\nSee more info here: https://nextjs.org/docs/api-reference/next/image#loader-configuration` `Specified images.loader property (${images.loader}) also requires images.path property to be assigned to a URL prefix.\nSee more info here: https://nextjs.org/docs/api-reference/next/image#loader-configuration`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment