An open API service indexing awesome lists of open source software.

https://github.com/innei/nextjs-metadata-url-encode-reproduction


https://github.com/innei/nextjs-metadata-url-encode-reproduction

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

Next.js metadata url will encodeURLComponent unexpectedly.

```ts

export const generateMetadata = async (): Promise => {
const ogUrl = new URL('http://localhost:3000/og.png')

ogUrl.searchParams.set('title', 'Nextjs')
ogUrl.searchParams.set('description', 'description - Nextjs')

return {
title: 'Nextjs',
openGraph: {
images: ogUrl,
},
}
}
```

and generate the code of `` tag.

```

```

The `&` will encode to `&` unexpected.