Skip to content

chore: prefer performance.now over Date.now in server component#2563

Merged
matthewvolk merged 1 commit intocanaryfrom
prep/composable-cache
Aug 29, 2025
Merged

chore: prefer performance.now over Date.now in server component#2563
matthewvolk merged 1 commit intocanaryfrom
prep/composable-cache

Conversation

@matthewvolk
Copy link
Copy Markdown
Contributor

What/Why?

Fixes the following error when cacheComponents is set to true

Cannot access Date.now(), Date(), or new Date() before other uncached data or Request data in a Server Component

Docs: https://nextjs.org/docs/messages/next-prerender-current-time

Testing

Before:
Screenshot 2025-08-29 at 2 25 33 PM

After:
Screenshot 2025-08-29 at 2 16 44 PM

Migration

Replace usage of Date.now with performance.now in @bigcommerce/catalyst-client

@matthewvolk matthewvolk requested a review from a team August 29, 2025 19:26
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 29, 2025

🦋 Changeset detected

Latest commit: cd74e9e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@bigcommerce/catalyst-client Patch
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
catalyst-b2b Ready Ready Preview Comment Aug 29, 2025 7:26pm
catalyst-canary Ready Ready Preview Comment Aug 29, 2025 7:26pm
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
catalyst Ignored Ignored Aug 29, 2025 7:26pm
catalyst-au Ignored Ignored Aug 29, 2025 7:26pm
catalyst-uk Ignored Ignored Aug 29, 2025 7:26pm

@matthewvolk matthewvolk added this pull request to the merge queue Aug 29, 2025
Merged via the queue into canary with commit 707ec24 Aug 29, 2025
14 checks passed
@matthewvolk matthewvolk deleted the prep/composable-cache branch August 29, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants