Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

bugfix: investigate ssr error in page document type #447

Conversation

muzanella11
Copy link
Contributor

@muzanella11 muzanella11 commented Sep 9, 2024

What's new:

  • Fix ssr error in page document type
  • Fix all warning console when build cms
  • Make cms more stable

Closes #439

@muzanella11 muzanella11 self-assigned this Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Visit the preview URL for this PR (updated for commit c79059d):

https://tanam-testing--pr447-issue-439-investigat-lued0rvq.web.app

(expires Mon, 16 Sep 2024 00:38:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5bbe8a1a68d9684d656bffba10008fe532204561

Copy link

nx-cloud bot commented Sep 23, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit b03b9cd. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx affected -t build e2e-ci

Sent with 💌 from NxCloud.

@muzanella11
Copy link
Contributor Author

I get this error only when visiting the /content/article page.
I'll take a look before making this PR ready to review.
Screen Shot 2024-09-24 at 08 21 41

@muzanella11 muzanella11 marked this pull request as ready for review September 24, 2024 08:12
Comment on lines -22 to -28
// NOTE(Dennis)
// The VoiceRecorder is using `navigator` to access the microphone, which creates issues with server-side rendering.
// The module must be dynamically imported to avoid problems when statically rendered components are generated.
const VoiceRecorder = dynamic(() => import("../../../../components/VoiceRecorder").then((mod) => mod.default), {
ssr: false,
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

return (
<Table
isLoading={isLoading}
headers={["Title", "Created", "Status"]}
rows={documents.map((document, key) => [
<Link key={`${key}-${document.id}-id`} href={`/content/${document.documentType}/${document.id}`}>
<p className="font-medium text-black dark:text-white">{document.data[documentType.titleField] as string}</p>
<p className="font-medium text-black dark:text-white">{(document.data.title as string) || ""}</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data field that represents "title" should be generic and defined by its document type. For example, in an article it makes most sense ot display title and the title. But when listing authors, it might make more sense to use the field name as a title in a list.

Keep the original implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

@DennisAlund DennisAlund merged commit d3708c7 into milestone/13-investigate-ssr-error Sep 25, 2024
1 of 2 checks passed
@DennisAlund DennisAlund deleted the issue/439-investigate-ssr-error-in-page-document-type branch September 25, 2024 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants