examples icon indicating copy to clipboard operation
examples copied to clipboard

fix(solutions/blog): resolve React version conflict error and async params bug

Open kxzb-fun opened this issue 8 months ago • 3 comments

Description

When I visit the blog details page (http://localhost:3003/blog/vim), the following error occurs:

at Blog (app/blog/[slug]/page.tsx:55:28)
  53 |
  54 | export default function Blog({ params }) {
> 55 |   let post = getBlogPosts().find((post) => post.slug === params.slug)
     |                                                                ^
  56 |
  57 |   if (!post) {
  58 |     notFound()
Error: Route "/blog/[slug]" used `params.slug`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis

and warnning:

Server   Error: Route "/blog/[slug]" used `params.slug`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
    at eval (page.tsx:55:65)
    at Blog (page.tsx:55:29)

so, I updated all of the dependencies and fixed warnning

Demo URL

Type of Change

  • [ ] New Example
  • [x] Example updates (Bug fixes, new features, etc.)
  • [ ] Other (changes to the codebase, but not to examples)

New Example Checklist

  • [ ] 🛫 npm run new-example was used to create the example
  • [ ] 📚 The template wasn't used but I carefuly read the Adding a new example steps and implemented them in the example
  • [ ] 📱 Is it responsive? Are mobile and tablets considered?

kxzb-fun avatar Apr 11 '25 01:04 kxzb-fun

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app-dir-css-in-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
app-dir-i18n ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
app-dir-share-state ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
edge-functions-cookies ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
edge-functions-news ❌ Failed (Inspect) Apr 11, 2025 1:43am
edge-functions-streams ❌ Failed (Inspect) Apr 11, 2025 1:43am
edge-geolocation-country-block ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
edge-middleware-modify-request-header ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
edge-user-agent-based-rendering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
example-reduce-image-bandwidth-usage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
i18n ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
next-edge-api-route-hello-world ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
nodejs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-combining-data-fetching-strategies ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-image-fallback ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-image-offset ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-loading-web-fonts ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-microfrontends ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-microfrontends-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-pagination-with-ssg ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-parallel-routes-navbar ❌ Failed (Inspect) Apr 11, 2025 1:43am
solutions-reuse-responses ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-script-component-ad ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am
solutions-script-component-strategies ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 1:43am

vercel[bot] avatar Apr 11 '25 01:04 vercel[bot]

@kxzb-fun is attempting to deploy a commit to the Vercel Examples Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 11 '25 01:04 vercel[bot]

Review the following changes in direct dependencies. Learn more about Socket for GitHub ↗.

Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/@tailwindcss/[email protected] ⏵ 4.1.310010080 +999 +1100
Updatednpm/[email protected] ⏵ 5.0.098 -11001008881 +11
Updatednpm/@vercel/[email protected] ⏵ 1.2.093 +110085 +194 +4100
Updatednpm/[email protected] ⏵ 1.3.110010010086 +290
Updatednpm/[email protected] ⏵ 0.9.3100100100 +194 +3100

View full report ↗

socket-security[bot] avatar Apr 11 '25 01:04 socket-security[bot]