Closed hansenz42 closed 1 month ago
After inspecting the source code, I discovered that removing the encodeURI
function around tag
in the generateStaticParams
method of app/tags/[tag]/page.tsx
will resolve the issue.
export const generateStaticParams = async () => {
const tagCounts = tagData as Record<string, number>
const tagKeys = Object.keys(tagCounts)
const paths = tagKeys.map((tag) => ({
tag: tag, // remove encodeURI
}))
return paths
}
Describe the bug When clicking on a Chinese tag, no blogs are displayed on the tag page.
To Reproduce Steps:
Expected behavior Blogs associated with the selected tag should be displayed on the page.
Screenshots
System Info (if dev / build issue):
Browser Info (if display / formatting issue):
Additional context This issue only occurs with Chinese tags; English tags work correctly. When using npm run dev, the functionality works as expected. However, the issue arises when deployed to Vercel or using npm run build.