nextra
nextra copied to clipboard
Suggestion to Add Reminder to Enable HTTPS in Development for `Copy code` Button Error
Hello,
I encountered an issue where clicking the Copy code button in code blocks triggers a Failed 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 that navigator.clipboard only works under HTTPS.
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.