Suggestion to Add Reminder to Enable HTTPS in Development for Copy code
Button Error
#4194
Labels
enhancement
New feature or request
Copy code
Button Error
#4194
Hello,
I encountered an issue where clicking the
Copy code
button in code blocks triggers aFailed to copy!
error in the local development environment:After investigating, I found that the error occurs because
navigator.clipboard.writeText()
fails, and the reason is thatnavigator.clipboard
only works under HTTPS.MDN Clipboard API
To improve the user experience, I suggest adding a note to the Nextra documentation informing users that they need to enable HTTPS for the copy button to function correctly, and that they can refer to the official Next.js documentation: Next.js - Using HTTPS During Development for instructions on enabling HTTPS in a development environment.
The text was updated successfully, but these errors were encountered: