Skip to content

Commit

Permalink
Relax restriction of images.path in next.config.js (vercel#30741)
Browse files Browse the repository at this point in the history
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 vercel#30080
  • Loading branch information
styfle authored and timneutkens committed Nov 2, 2021
1 parent 21b0d19 commit f1ade90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function assignDefaults(userConfig: { [key: string]: any }) {
if (
images.loader !== 'default' &&
images.loader !== 'custom' &&
!(images.path || '').startsWith('http')
images.path === imageConfigDefault.path
) {
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`
Expand Down

0 comments on commit f1ade90

Please sign in to comment.