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

docusaurus start command shows DeprecationWarning: The punycode module is deprecated. #10107

Open
6 of 7 tasks
mamiu opened this issue May 6, 2024 · 2 comments
Open
6 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Milestone

Comments

@mamiu
Copy link

mamiu commented May 6, 2024

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

When starting a dev server of the latest version of Node (v22.1.0) and Docusaurus (v3.3.2) with npm start (docusaurus start) I'll get the following warning:

DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

This is due to the fact that docusaurus/core has serve-handler as a dependency.
And serve-handler itself depends on fast-url-parser which seems to be the root cause of this warning.

Is there anything Docusaurus can do to fix this or does the serve-handler project have to refactor its code from fast-url-parser to Node's native url module instead?

Reproducible demo

No response

Steps to reproduce

npx create-docusaurus@latest my-website classic
cd my-website
npm run start

Expected behavior

Don't show any warnings in the console.

Actual behavior

When starting a dev server of the latest version of Node (v22.1.0) and Docusaurus (v3.3.2) with npm start (docusaurus start) I'll get the following warning:

DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Your environment

No response

Self-service

  • I'd be willing to fix this bug myself.
@mamiu mamiu added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels May 6, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label May 9, 2024
@slorber
Copy link
Collaborator

slorber commented May 9, 2024

Thanks

Normally we'd wait for serve-handler to update and fix the problem. Unfortunately, I doubt serve-handler is well-maintained these days, and not sure a fix will be published. We'd probably have to patch it ourselves.


It's a bit risky to change server implementation in a minor release, but we might drop serve-handler in a major if we find a good alternative. I don't know the current landscape of alternatives to serve a static deployment.

There's Nitro, but its primary use-case does not look like to be static deployments, although it could be interesting in the future if we want to add support for Docusaurus server-side features (do we?).

@slorber slorber added this to the 4.0 milestone May 9, 2024
@mamiu
Copy link
Author

mamiu commented May 14, 2024

@slorber I agree that serve-handler is not well-maintained anymore. But also don't know of any good alternatives.

[...] if we want to add support for Docusaurus server-side features (do we?).

I would absolutely love to see Docusaurus moving into this direction (as long as they stay optional).
With server-side features there would be endless possibilities to make Docusaurus way better than it already is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

2 participants