I'm currently facing an issue with the LinkedInBot (tool used for linkedin when you try to share one page on their platform) not accessing the dynamic URLs correctly in my Next.js application hosted on Vercel. Instead of accessing the expected URL format, the LinkedInBot is attempting to access an encoded version of the URL with route parameters enclosed in square brackets.
Normally I'm able to access the page [GET] /2023/07/como-implementar-diversidade-na-documentacao
and it goes under the [year]/[month]/[slug].tsx
file. It works fine, but when I try to share a link on LinkedIn it gets 404, ans in the Vercel Logs I found out that LinkedInBot tried to access [GET] /%5Byear%5D/%5Bmonth%5D/%5Bslug%5D
instead.
Source code of the page: https://github.com/vtnorton/vtnorton.com/blob/main/src/pages/%5Byear%5D/%5Bmonth%5D/%5Bslug%5D.tsx
Attempts to solve the issue:
- I have verified that the shared URL on LinkedIn contains the correct URL with dynamic values.
- I have ensured that the logic for loading data for the dynamic pages is functioning correctly.
NextJS: 13.4.6