-
Notifications
You must be signed in to change notification settings - Fork 39
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
bugfix: investigate ssr error in page document type #447
Conversation
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 |
…stigate-ssr-error-in-page-document-type
☁️ Nx Cloud ReportCI 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
Sent with 💌 from NxCloud. |
…stigate-ssr-error-in-page-document-type
// 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, | ||
}); | ||
|
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ✅
d3708c7
into
milestone/13-investigate-ssr-error
What's new:
Closes #439