Skip to content
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

Suggestion to Add Reminder to Enable HTTPS in Development for Copy code Button Error #4194

Open
ks4na opened this issue Feb 11, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@ks4na
Copy link

ks4na commented Feb 11, 2025

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:

Image

After investigating, I found that the error occurs because navigator.clipboard.writeText() fails, and the reason is that navigator.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.

@ks4na ks4na added the enhancement New feature or request label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant