Skip to content

Commit

Permalink
Remove warning for metadataBase fallback (#48196)
Browse files Browse the repository at this point in the history
[slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1681079578508909)

Remove the warning for metadataBase when it fallback to default value,
as it's already clarified in
[docs](https://beta.nextjs.org/docs/api-reference/metadata#metadatabase)
  • Loading branch information
huozhi committed Apr 11, 2023
1 parent af12a94 commit 83e05e6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 84 deletions.
6 changes: 0 additions & 6 deletions packages/next/src/lib/metadata/resolvers/resolve-url.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from '../../../shared/lib/isomorphic/path'
import * as Log from '../../../build/output/log'

function isStringOrURL(icon: any): icon is string | URL {
return typeof icon === 'string' || icon instanceof URL
Expand All @@ -26,11 +25,6 @@ function resolveUrl(

if (!metadataBase) {
metadataBase = new URL(`http://localhost:${process.env.PORT || 3000}`)
// Development mode warning, add new line prefix for worker output
console.log()
Log.warn(
`metadata.metadataBase is not set for resolving url "${url}", fallbacks to "${metadataBase.origin}". See https://beta.nextjs.org/docs/api-reference/metadata#metadatabase`
)
}

// Handle relative or absolute paths
Expand Down

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions test/e2e/app-dir/metadata-missing-metadata-base/app/layout.js

This file was deleted.

31 changes: 0 additions & 31 deletions test/e2e/app-dir/metadata-missing-metadata-base/index.test.ts

This file was deleted.

This file was deleted.

0 comments on commit 83e05e6

Please sign in to comment.