Skip to content

Commit

Permalink
Fix .images.remotePatterns[0].port warning (#44032)
Browse files Browse the repository at this point in the history
The json schema was incorrectly warning because `port: ''` is valid and we document and use it in examples. The empty string is different than undefined

- empty string: match only URLs without a port
- undefined: match URLs with any port

I noticed this when running one of our examples:

```
pnpm next dev examples/image-component
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warn  - Invalid next.config.js options detected:
  - The value at .images.remotePatterns[0].port must be 1 character or more but it was 0 characters.
See more info here: https://nextjs.org/docs/messages/invalid-next-config
```
  • Loading branch information
styfle committed Dec 14, 2022
1 parent 7c1ac89 commit d5fd2d7
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/next/server/config-schema.ts
Expand Up @@ -572,7 +572,6 @@ const configSchema = {
type: 'string',
},
port: {
minLength: 1,
type: 'string',
},
protocol: {
Expand Down

0 comments on commit d5fd2d7

Please sign in to comment.