Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: await params for board metadata #2406

Merged
merged 1 commit into from
Feb 23, 2025
Merged

fix: await params for board metadata #2406

merged 1 commit into from
Feb 23, 2025

Conversation

Meierschlumpf
Copy link
Member


Homarr

Thank you for your contribution. Please ensure that your pull request meets the following pull request:

  • Builds without warnings or errors (pnpm build, autofix with pnpm format:fix)
  • Pull request targets dev branch
  • Commits follow the conventional commits guideline
  • No shorthand variable names are used (eg. x, y, i or any abbrevation)

Fixes the following issue:

@homarr/nextjs:dev: Error: Route "/[locale]/boards/[name]" used `params.name`. `params` should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
@homarr/nextjs:dev:     at getInitialBoardAsync (file://C%3A/Dev/alparr-labs/homarr/apps/nextjs/apps/nextjs/src/app/%5Blocale%5D/boards/%28content%29/%5Bname%5D/%28board%29/_definition.tsx:6:31)
@homarr/nextjs:dev:     at Module.generateMetadataAsync (file://C%3A/Dev/alparr-labs/homarr/apps/nextjs/apps/nextjs/src/app/%5Blocale%5D/boards/%28content%29/_creator.tsx:46:28)
@homarr/nextjs:dev:   4 |
@homarr/nextjs:dev:   5 | export default createBoardContentPage<{ locale: string; name: string }>({
@homarr/nextjs:dev: > 6 |   async getInitialBoardAsync({ name }) {
@homarr/nextjs:dev:     |                               ^
@homarr/nextjs:dev:   7 |     return await api.board.getBoardByName({ name });
@homarr/nextjs:dev:   8 |   },
@homarr/nextjs:dev:   9 | });

@Meierschlumpf Meierschlumpf requested a review from a team as a code owner February 23, 2025 13:26
Copy link

deepsource-io bot commented Feb 23, 2025

Here's the code health analysis summary for commits c5107b2..aa76fd1. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 21.5% 8845 / 41136
🔵 Statements 21.5% 8845 / 41136
🔵 Functions 26.78% 346 / 1292
🔵 Branches 62.03% 1013 / 1633
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx 0% 0% 0% 0% 1-71
Generated in workflow #5243 for commit aa76fd1 by the Vitest Coverage Report Action

@Meierschlumpf Meierschlumpf merged commit 2085b5e into dev Feb 23, 2025
13 checks passed
@Meierschlumpf Meierschlumpf deleted the fix-await-params branch February 23, 2025 14:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants