I have a copyright component which takes the current year using Date API, which throws a mysterious error (included as image attachment of this post) I've never seen before updating to canary. Next.js thinks that I am using Date API for performance benchmarking and warns me that I should be using performance API instead, however I am using Date for displaying the current year.
The linked docs on the topic do not specify how to fix this, and instead just tell me to switch to using performance. Any ideas for fixes?
"use client"
function Copyright() {
const year = new Date().getFullYear()
return <span>© {year} Company Name. All rights reserved.</span>
}
Error text:
Error: Route "/" used `new Date()` instead of using `performance` or without explicitly calling `await connection()` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time